This REPO is not actively maintained. Crecto is works with Crystal 1.0. Please contact me or create an issue if you would like to take over as maintainer of Crecto.
Robust database wrapper for Crystal. Inspired by Ecto for Elixir language.
With built in query composer, associations, transactions, validations, constraints, and more.
Website with guides and examples - https://www.crecto.com/
See api docs - http://docs.crecto.com
user = User.new user.name = "Shakira" changeset = Repo.insert(user) changeset.errors.any? inserted_user = changeset.instance inserted_user.name = "Keanu" changeset = Repo.update(user) changeset.errors.any? updated_user = changeset.instance changeset = Repo.delete(updated_user)
Usage and Guides
- Fork it ( https://github.com/fridgerator/crecto/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
When developing against crecto, the database must exist prior to
testing. There are migrations for each database type in
and references on how to migrate then in the
Create a new file
spec/repo.cr and create a module name
Repo to use for testing.
There are example repos for each database type in the spec folder:
When submitting a pull request, please test against all 3 databases.