Redis backend for CROM ( CRystal Object Mapper)
Add this to your application's shard.yml
:
dependencies:
crom-redis:
github: TechMagister/crom-redis.cr
- Insert Basic Object
- Update Basic Object
- Delete Basic Object
- Fetch by Id
- Aggregation support
require "crom-redis"
class User
CROM.mapping(:redis, {
name: String,
age: Int32,
})
end
class Users < CROM::Redis::Repository(User)
end
crom = CROM.container("redis://") # eq redis://localhost:6379
# user_repo = Users.new crom
# or
# CROM.register_repository Users.new crom
# if repo = Users.repo
# ... do stuff ...
# end
To run spec, run a redis server and configure the URI in ./spec/spec_helper.cr
- Fork it ( https://github.com/TechMagister/crom-redis.cr/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
- TechMagister Arnaud Fernandés - creator, maintainer