Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDTs creation #10

Closed
rashtao opened this issue Jul 2, 2015 · 3 comments
Closed

UDTs creation #10

rashtao opened this issue Jul 2, 2015 · 3 comments

Comments

@rashtao
Copy link

rashtao commented Jul 2, 2015

It would be great to have a method to create User-Defined-Types:
http://docs.datastax.com/en/cql/3.1/cql/cql_reference/cqlRefcreateType.html

@rashtao
Copy link
Author

rashtao commented Jul 6, 2015

see #11

@UnbounDev
Copy link
Contributor

Continuing discussion on UDT creation integration...

The current proposed implementation has the following call signature for creating a type:

cassanKnex("cassanKnexy")
           .createType("myType")
           .text("textType")
           .list("listType", "text");

Which seems appropriate, what we're missing is a suitable signature for using that type in a createColumnFamily statement; since UUDT's in Cassandra require the frozen keyword I'd prefer something like the following (for standard columns/sets/maps):

var cql = cassanKnex("ks")
    .createColumnFamilyIfNotExists("cf")
    .frozen("uudtType", "myType");
// compiles => CREATE TABLE ks.cf ( uudtType frozen <myType> ) ;

// and
    .frozenSet("uudtTypeSet", "myType");
// compiles => CREATE TABLE ks.cf ( uudtType set<frozen <myType>> ) ;

// and
    .frozenMap("uudtTypeMap", "standardType", "myType");
// compiles => CREATE TABLE ks.cf ( uudtType map<standardType, frozen <myType>> ) ;

@rashtao
Copy link
Author

rashtao commented Jul 7, 2015

I agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants