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

Wrap names with double quotation marks #14

Closed
rashtao opened this issue Jul 16, 2015 · 2 comments · Fixed by #18
Closed

Wrap names with double quotation marks #14

rashtao opened this issue Jul 16, 2015 · 2 comments · Fixed by #18
Assignees

Comments

@rashtao
Copy link

rashtao commented Jul 16, 2015

With this command:

cassanKnex("ks").createColumnFamily("cf")
        .text("textType")
        .uuid("uuidType")
        .timestamp("timestamp")
        .primary(["textType", "uuidType"], "timestamp");

I get the following CQL query generated:

CREATE COLUMNFAMILY ks.cf ( textType TEXT, uuidType UUID, timestamp TIMESTAMP, PRIMARY KEY ((textType, uuidType), timestamp) ) ;

But this will be stored in Cassandra with all the names lowercase:

> DESCRIBE TABLE cf ;

CREATE TABLE ks.cf (
    texttype text,
    uuidtype uuid,
    "timestamp" timestamp,
    PRIMARY KEY ((texttype, uuidtype), "timestamp")
) 
...

This happens because:

Keyspace, column, and table names created using CQL 3 are case-insensitive unless enclosed in double quotation marks ... http://docs.datastax.com/en/cql/3.0/cql/cql_reference/ucase-lcase_r.html

It would be nice to have in the generated CQL queries all the Keyspaces, columns, and tables names always enclosed in double quotation marks, allowing to specify uppercase letters.

@UnbounDev
Copy link
Contributor

@rashtao can you pull the develop branch and see that your use cases are covered by the enhancements?

@rashtao
Copy link
Author

rashtao commented Jul 22, 2015

@UnbounDev it seems ok!

@UnbounDev UnbounDev mentioned this issue Jul 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants