{"id":16918864,"url":"https://github.com/namusyaka/dinamo","last_synced_at":"2025-03-22T11:30:47.044Z","repository":{"id":56844231,"uuid":"47545309","full_name":"namusyaka/dinamo","owner":"namusyaka","description":"DynamoDB ORM for Ruby","archived":false,"fork":false,"pushed_at":"2017-11-15T12:45:45.000Z","size":36,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T06:15:58.377Z","etag":null,"topics":["aws","dynamodb","orm","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/namusyaka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-07T10:27:35.000Z","updated_at":"2019-07-10T10:45:51.000Z","dependencies_parsed_at":"2022-08-26T13:51:47.180Z","dependency_job_id":null,"html_url":"https://github.com/namusyaka/dinamo","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namusyaka%2Fdinamo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namusyaka%2Fdinamo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namusyaka%2Fdinamo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namusyaka%2Fdinamo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/namusyaka","download_url":"https://codeload.github.com/namusyaka/dinamo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244951098,"owners_count":20537319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","dynamodb","orm","ruby"],"created_at":"2024-10-13T19:42:01.230Z","updated_at":"2025-03-22T11:30:46.231Z","avatar_url":"https://github.com/namusyaka.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dinamo\n\n[![build status](https://img.shields.io/travis/namusyaka/dinamo.svg?style=flat-square)](http://travis-ci.org/namusyaka/dinamo)\n[![gem](https://img.shields.io/gem/v/dinamo.svg?style=flat-square)](https://rubygems.org/gems/dinamo)\n[![license](https://img.shields.io/github/license/namusyaka/dinamo.svg?style=flat-square)](https://github.com/namusyaka/dinamo/blob/master/LICENSE.txt)\n\nDinamo is an ORM for [Dynamo DB](https://aws.amazon.com/dynamodb/), it has followed the behavior of the ORM which is often seen in the Ruby culture.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'dinamo'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install dinamo\n\n## Overview\n\nDinamo makes it easy to create DynamoDB record from any ruby object. Also, dinamo supports for [data types of Dynamo DB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html) such as scaler types, document types and set types. This means things that you can declare their types on your model.\n\nOf course, you can use validations, casting and model change tracking smoothly.\nNext section will describe their things with example code.\n\n## Usage\n\n### Model definition\n\n```ruby\nclass User \u003c Dinamo::Model\n  hash_key :name, type: :string\n  field    :age,  type: :number\nend\n```\n\n### Building/Saving\n\n```ruby\nuser = User.new(name: 'numb', age: 24)\nuser.persisted? #=\u003e false\nuser.save\nuser.persisted? #=\u003e true\n```\n\nOr you can use `create`.\n\n```ruby\nuser = User.create(name: 'numb', age: 24)\nuser.persisted? #=\u003e true\n```\n\n### Dirty (model change tracking)\n\n```ruby\nuser = User.new(name: 'numb', age: 24)\nuser.changed? #=\u003e false\nuser.age = 25\nuser.changed? #=\u003e true\nuser.save\nuser.changed? #=\u003e false\n```\n\n### Validation\n\n```ruby\nclass NameLengthValidator \u003c Dinamo::Model::Validation::Validator\n  def validate(record)\n    unless options[:length].include?(record.name.length)\n      record.errors.add(:name, I18n.t(\"models.user.error.length\"))\n    end\n  end\nend\n\nclass User \u003c Dinamo::Model\n  hash_key :id\n  field :name, type: :string\n\n  validates_with NameLengthValidator, length: 1..30\nend\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/namusyaka/dinamo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamusyaka%2Fdinamo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamusyaka%2Fdinamo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamusyaka%2Fdinamo/lists"}