Persist your objects to Cassandra -- conforms to ActiveModel API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
lib
test
.document
.gitignore
LICENSE
README.md
Rakefile
VERSION
cassandra_model.gemspec

README.md

CassandraModel

Persist your objects to Cassandra -- conforms to ActiveModel API

Getting Started

Note: If you haven't already, make sure you have Cassandra configured and running. Here are a few resources to get you started:

Configuration

You must configure CassandraModel with your keyspace and hosts:

CassandraModel.config(:keyspace => "MyApp", :hosts => "127.0.0.1:9160")

Define a Model

class User
  include CassandraModel::Resource
  
  column :email
  column :name
end

Creating

@user = User.new(:email => 'bsmith@swig505.com', :name => "Brian Smith")
@user.save
puts "Key: #{@user.key}"  # Note that a key will be auto-generated (GUID) if none is given

Fetching

@user = User.get("11cb871a-338b-11df-9f62-ef46bcab0d62")
puts "#{@user.email} / #{@user.name}"

Copyright

Copyright (c) 2010 Brian Smith. See LICENSE for details.