Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.
/ crom-redis.cr Public archive

Redis backend for CROM ( CRystal Object Mapper)

License

Notifications You must be signed in to change notification settings

TechMagister/crom-redis.cr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crom-redis

Redis backend for CROM ( CRystal Object Mapper)

Installation

Add this to your application's shard.yml:

dependencies:
  crom-redis:
    github: TechMagister/crom-redis.cr

Features

  • Insert Basic Object
  • Update Basic Object
  • Delete Basic Object
  • Fetch by Id
  • Aggregation support

Usage

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

Development

To run spec, run a redis server and configure the URI in ./spec/spec_helper.cr

Contributing

  1. Fork it ( https://github.com/TechMagister/crom-redis.cr/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

Contributors

About

Redis backend for CROM ( CRystal Object Mapper)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published