On Friday, November 8, 2013 4:47:58 PM UTC-8, David Leung wrote:

> I'm trying to write the cassandra cql-rb adapter for sequel, and I have a 
> working branch here: 
> https://github.com/dleung/sequel/tree/adapter/cassandra.  I'm trying to 
> run the database integration tests, specifically:
>
> @db.create_table!(:items){Integer :i}
> # => Cql::QueryError: No PRIMARY KEY specifed (exactly one required)
>
> Cassandra *requires* at least a column to be defined as the primary_key, 
> and the defined integration tests tests aren't specifying any.
>
> In my working branch, this command works:
> @db.create_table!(:items){Integer :i, primary_key: true}
> and creates the this table in the default keyspace using 'i' as the 
> primary key.
>
> What's the recommended course of action here?  Should I default a column 
> to a primary key column if none is specified?  However, defining which 
> columns to be the primary key(s), since cassandra can support single or 
> compound primary keys, is what their documentation encourages.
>

I'm assuming the failing spec is line 15 in database_spec.rb.  As that 
isn't testing for the ability to create a table without a primary key (it's 
testing disconnect after prepare), it's acceptable to change it in that 
particular case.  Changes to the integration test suite to work around 
bugs/limitations in specific databases are generally scrutinized heavily, 
with the main criteria being is what is being changed related to what is 
being tested.  If they are not related, it's probably OK, otherwise 
probably not.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to