Coder Social home page Coder Social logo

eprothro / cassie Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 483 KB

Ruby application support for Apache Cassandra

Home Page: https://rubygems.org/gems/cassie

License: MIT License

Ruby 99.95% Shell 0.05%
cassandra schema ruby database-configuration migrations versioning query-dsl

cassie's People

Contributors

eprothro avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

cassie's Issues

Allow interoperability for fake session and real session prepared statements

preparing a statement through the fake session results in a fake prepared statement being put in the statement cache.

If that fake prepared statement is then executed later with a real session, there can be type hinting issues like

Cassandra::Errors::InvalidError:
       Expected 4 or 0 byte int (8)

Only affects test/spec query usage.

add support for UDTs to `to_cql`

to_cql falls over with certain UDTs with exception message like

ArgumentError:
       value must be an instance of Time, ["foo_at", 2017-10-31 12:10:00 -0500] given

fetch_first doesn't work when cursoring is enabled

If cursor_by has been called on a cassie query class, fetch_first will fail, with:

A singleton method has already been defined for `limit`. `with_limit` can't be implemented.
     # ./lib/cassie/statements/statement/limiting.rb:89:in `assert_no_limit_singleton'
     # ./lib/cassie/statements/statement/limiting.rb:70:in `define_limit_singleton'
     # ./lib/cassie/statements/statement/limiting.rb:46:in `with_limit'
     # ./lib/cassie/statements/execution/peeking.rb:12:in `execute'
     # ./lib/cassie/statements/execution/fetching.rb:25:in `fetch'
     # ./lib/cassie/statements/execution/fetching.rb:38:in `block in fetch_first'

Add rspec matchers for cassandra statements

expect(query.statement).to have_cql_assignment(:field)
expect(query.statement).to have_cql_assignment(:field, value)
expect(query.statement).to have_cql_relation(:field)
expect(query.statement).to have_cql_relation(:field, value)

Would go a long way for clients to be able to stop their testing plane sooner and have faster cassandra query coverage.

schema:init - Doesn't support multiple DC out of the box

cassie schema management keyspace is created with simple replication strategy, if you have a cluster with a multiple DC configuration, the cassie schema tasks will fail.

Workaround:

Attempt to initialize

cassie schema:init

Alter the keyspace manually

Edit the cassie_schema keyspace manually (in cqlsh) to have the proper replication settings.

initialize again

cassie schema:init

Make Query#to_cql handle invalid values more clearly

type
#=> #<Cassandra::Types::Simple:0x007fed37c33300 @kind=:bigint>

params[i]
#=> nil

params
#=> ["55e05d24-513b-11e7-b6b8-33c23e6e0000", 2017-06-14 14:54:54 -0500, nil, nil, "55e0893e-513b-11e7-bd08-0f7a965973cc", "testuser94517816"]

bound_cql
#=> "INSERT INTO some_table (id, other_id, url, other_url, user_id, username) VALUES (?, ?, ?, ?, ?, ?);"

type
#<Cassandra::Types::Simple:0x007fed37c33300 @kind=:bigint>

type.new(nil)
     TypeError:
       can't convert nil into Integer

would be nice to catch type errors and give more info about what param is the culprit.

tasks that drop schema often time out

Cassandra::Errors::TimeoutError for non-trivial schemas when running:

  • schmea:drop
  • schema:reset
  • migrate:reset

Cassandra received request and executes successfully, but times out while doing so, so rest of task doesn't run after that failure.

In all cases there should be no harm in simply re-running.

However, probably a good idea to set the query timeout longer for these queries.

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.