azuqua / cassanknex

A CQL query builder written in the spirit of Knexjs
MIT License
50 stars 10 forks source link

frozen<...> support #11

Closed rashtao closed 9 years ago

rashtao commented 9 years ago

This should allow queries like this:

var cql = cassanKnex("ks")
    .createColumnFamilyIfNotExists("cf")
    .text("textType")
    .frozen("frozen_field", "list<text>")
    .primary("textType");
UnbounDev commented 9 years ago

@rashtao thanks for the contribution! Can you provide an appropriate test case w/i the keyspace test file? Tests can be run using grunt; additionally, you can test the execution of the query against a live cassandra instance by adding a use case to the live test file and run using grunt test-live (if you'd like, I'm satisfied w/ seeing an appropriately formatted CQL statement generated and checked by the keyspace tests).

rashtao commented 9 years ago

I wrote the tests and implemented also a basic support for UDTs creation. I have just duplicated the ColumnFamily code, so since types DDL is just a subset of tables DDL (right?!?!) we already have all the methods implemented. Of course there is a subset of methods that are valid for tables but not for types... So maybe we could work a bit more on the refinements of this...

UnbounDev commented 9 years ago

@rashtao yes - we should discuss and refine before pushing a release :). Can you close this PR and re-open it against the develop branch (I'll merge it there)? I'd like to clone and work on the updates/test; when it's ready we'll merge w/ master (gitflow ftw).