Giter Club home page Giter Club logo

cassanity's People

Contributors

alindeman avatar calonso avatar greatuserongithub avatar jnunemaker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cassanity's Issues

Fails with stock cassandra 1.2.1

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?

Schema discovery

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?

Support WITH COMPACT STORAGE

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}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.