当前位置: 首页 > 软件库 > 数据库相关 > >

crecto

授权协议 MIT License
开发语言 C/C++
所属分类 数据库相关
软件类型 开源软件
地区 不详
投 递 者 姜凯风
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

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.

Crecto

https://www.crecto.com/

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

Example

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

Visit www.crecto.com

Benchmarks

Contributing

  1. Fork it ( https://github.com/fridgerator/crecto/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Development Notes

When developing against crecto, the database must exist prior totesting. There are migrations for each database type in spec/migrations,and references on how to migrate then in the .travis.yml file.

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: travis_pg_repo.cr,travis_mysql_repo.cr, and travis_sqlite_repo.cr

When submitting a pull request, please test against all 3 databases.

Thanks / Inspiration

相关阅读

相关文章

相关问答

相关文档