Skip to content

danielcremer/helenus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helenus

Helenus is a Ruby to Cassandra persistence library

Usage

First setup the client:

Helenus::setup('127.0.0.1:9160', {:keyspace => 'keyspaceName'})

Setup and use a model:

class Person
  include Helenus

  property :name, String
  property :email, String, :index => true
end

john = Peron.create(:name => "John", :email => "[email protected]")
john.email = "[email protected]"
john.save

# Query the 2i
Person.find_by(:email, "[email protected]") # => returns john

This object will manage it's own secondary index for any properties with the index property set to true.

Pluggable id generation

By default Helenus uses the simple_uuid gem to generate ids automatically. You can plug in your own id generation logic:

class Person
  include Helenus
  id_generator Proc.new { Time.now.to_f }
end

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages