jnunemaker / cassanity Goto Github PK
View Code? Open in Web Editor NEWBrings sanity to CQL + Ruby.
Home Page: http://jnunemaker.github.com/cassanity
License: MIT License
Brings sanity to CQL + Ruby.
Home Page: http://jnunemaker.github.com/cassanity
License: MIT License
Running a cassandra 1.2.1 server locally, fully default configuration, get the following exception when I use cassanity:
[5] pry(main)> Cassanity::Client.new('127.0.0.1:9160')
CassandraCQL::Error::InvalidRequestException: Cannot execute/prepare CQL2 statement since the CQL has been set to CQL3(This might mean your client hasn't been upgraded correctly to use the new CQL3 methods introduced in Cassandra 1.2+).
from /Users/mconway/.rvm/gems/jruby-1.7.2/gems/cassandra-cql-1.1.5/lib/cassandra-cql/database.rb:101:in `execute_cql_query'
Does cassanity require CQL3? Any workarounds?
See #29 for context.
I may have missed something, but is there a way to use Cassanity to return the schema of an existing column family?
As a schema evolves over time, with migrations, and may be accessed by clients which did not create the schema, we might not have access to a canonical description of the schema at connection time. We might want to discover what the primary key is for a table, but I can't see how to achieve that.
Is it possible, and if not would some investigation of how to add something like that be of value to anyone except us?
Tests are failing on 2.0 and we need to get it fixed and keep it that way.
Also alias tables to it.
I can't create a column family with compact storage (a new option for CQL 3.0 for wide rows). The problem is that the :with
option is expecting a hash of values or hashes. COMPACT STORAGE
is unique since it doesn't have a value.
I have this patch:
diff --git a/lib/cassanity/argument_generators/with_clause.rb b/lib/cassanity/argument_generators/with_clause.rb
index f4c82c3..fa4516e 100644
--- a/lib/cassanity/argument_generators/with_clause.rb
+++ b/lib/cassanity/argument_generators/with_clause.rb
@@ -17,9 +17,11 @@ module Cassanity
withs << "#{key}:#{sub_key} = ?"
variables << sub_value
end
- else
+ elsif value
withs << "#{key} = ?"
variables << value
+ else
+ withs << key
end
end
It let's me do this:
with: {'COMPACT STORAGE' => nil}
I haven't looked at the other column family options to see if something like true
would be a problem. Or maybe we just look for :compact_storage
as a special key?
with: {:compact_storage => true}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.