{"id":13778234,"url":"https://github.com/malin-as/hanami-sequel","last_synced_at":"2025-09-29T18:32:20.410Z","repository":{"id":29987177,"uuid":"122582952","full_name":"malin-as/hanami-sequel","owner":"malin-as","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-16T05:43:35.000Z","size":51,"stargazers_count":4,"open_issues_count":2,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-04T10:03:27.272Z","etag":null,"topics":["database-migrations","hanami","sequel"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/malin-as.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-23T06:36:37.000Z","updated_at":"2024-01-15T10:28:07.000Z","dependencies_parsed_at":"2024-01-15T08:06:52.144Z","dependency_job_id":null,"html_url":"https://github.com/malin-as/hanami-sequel","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":"0.12121212121212122","last_synced_commit":"ea23e1ad9da560cbe667a174f657e44229a92128"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malin-as%2Fhanami-sequel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malin-as%2Fhanami-sequel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malin-as%2Fhanami-sequel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malin-as%2Fhanami-sequel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malin-as","download_url":"https://codeload.github.com/malin-as/hanami-sequel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253560026,"owners_count":21927719,"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":["database-migrations","hanami","sequel"],"created_at":"2024-08-03T18:00:52.260Z","updated_at":"2025-09-29T18:32:20.355Z","avatar_url":"https://github.com/malin-as.png","language":"Ruby","funding_links":[],"categories":["Hanami Gem List"],"sub_categories":["Database"],"readme":"# Hanami::Sequel\n\nThis gem is designed to replace the `hanami-model` one in your\n[Hanami](https://hanamirb.org/) project. It adds an equivalent set of database\ncommands to the `hanami` executable, and generates Sequel models.\n\nPlease note that using this gem could be considered bad practice with regards\nto Hanami’s architectural goals, as it does not provide any help to separate\nthe model into entities and repositories. On the other hand, it does nothing to\nprevent it either.\n\n## Installation\n\nFollow the instructions for removing `hanami-model`:\n[Use Your Own ORM](http://hanamirb.org/guides/1.1/models/use-your-own-orm/)\n\nAdd this line to your `config/environment.rb`:\n\n```ruby\nrequire \"hamani/sequel/model\"\n```\n\nAdd this line to your application’s Gemfile (adding the gem to the `plugins`\ngroup ensures that the `hanami` executable is correctly extended):\n\n```ruby\ngroup :plugins do\n  gem 'hanami-sequel', '~\u003e 1.1.0'\nend\n```\n\nAnd then execute:\n\n    $ bundle\n\n## Versioning\n\nThis gem’s version is based on the major and minor versions of Hanami. For\n`hanami-X.Y.Z`, use `hanami-sequel-X.Y.P`. This gem’s patch version (denoted as\n`P`) is independent from Hanami’s patch version (denoted as `Z`).\n\n## Configuration\n\nAs of now, the paths to migrations and models are hardcoded respectively to\n`db/migrations/` and `lib/#{project_name}/models/`.\n\n## Usage\n\nAll the commands start with the `sequel` argument:\n\n```text\nCommands:\n  hanami sequel create\n  hanami sequel drop\n  hanami sequel install\n  hanami sequel migrate [VERSION]\n  hanami sequel migration NAME\n  hanami sequel model NAME\n  hanami sequel seed\n```\n\n#### Create a database table\n\n    $ hanami sequel model NAME\n\nWhere `NAME` is the name of the model. This creates a database migration, a\nSequel model and a spec file. Additionally, a Sequel spec helper file will be\ncreated if none exists.\n\n#### Create a database migration\n\n    $ hanami sequel migration NAME\n\nWhere `NAME` is an arbitrary name.\n\n#### Create the database\n\n    $ hanami sequel create\n\nThis command will fail in the `production` environment.\n\n#### Migrate the database\n\n    $ hanami sequel migrate [VERSION]\n\nWhere `VERSION` can be:\n\n* \"up\" (default value), to do all the migrations, i.e. `hanami sequel migrate`\n  or `hanami sequel migrate up`.\n* \"down\", to undo all the migrations, i.e. `hanami sequel migrate down`.\n* a timestamp, representing the first part of the target migration file. E.g.\n  `hanami sequel migrate 20180201153930` to migrate to the database version as\n  of 1st February 2018 at 15:39:30 (if a migration file starting with this\n  value is found).\n\n#### Seed the database\n\n    $ hanami sequel seed\n\nThis command will look up your models for `Hanami:Sequel:Seed` class methods\nused to import constants into your tables. If an error occurs, the whole `seed`\noperation will be rolled back.\n\n#### Drop the database\n\n    $ hanami sequel drop\n\nThis command will fail in the `production` environment.\n\n#### Install the database\n\n    $ hanami sequel install\n\nThis command `drop`s, `create`s, `migrate`s, then `seed`s your database. It\nwill fail in the `production` environment.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run\n`rake spec` to run the tests. You can also run `bin/console` for an interactive\nprompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To\nrelease a new version, update the version number in `version.rb`, and then run\n`bundle exec rake release`, which will create a git tag for the version, push\ngit commits and tags, and push the `.gem` file to\n[rubygems.org](https://rubygems.org).\n\n## Known issues / To-do list\n\n* hardcoded configuration values\n* no tests\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at\n[https://github.com/malin-as/hanami-sequel](https://github.com/malin-as/hanami-sequel).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalin-as%2Fhanami-sequel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalin-as%2Fhanami-sequel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalin-as%2Fhanami-sequel/lists"}