I have a "problem" that I think Cassandra is well-suited to solve but having some trouble on how to setup the primary key.
Essentially there are 5 columns that I want the primary key to span. This is specifically (and only) used for de-duplication. For example:
class IDontKnowWtfIAmDoing
include Cequel::Record
column :some_id, :bigint
column :some_type, :text
column :something, :text
column :somewhere_id, :bigint
column :something_type, :text
column :wtf_dt, :timestamp
timestamps
end
But I want a primary key that covers [:some_id, :some_type, :something, :somewhere_id, :something_type]
I have this working fine outside of Cequel, but since "IF NOT EXISTS" is going to be added at some point I'd like to build with as much of Cequel as possible.
All the examples show something like:
key :id, :uuid
But in this case I want:
key [ .. bunch of keys ]
Is it possible to model Cequel using this?
Obviously putting a separate primary key would defeat the purpose of using it to deduce across these columns. I suppose I could create a hash of them, but that seems hack-esque.
- Greg