Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

query_builder

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

query_builder

  • 0.0.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

QueryBuilder

Gem Version Build Status Dependency Status Code Climate Coverage Inline docs

Builder of CQL 3 (Cassandra Query Language) statements in OOP style.

Synopsis

require "query_builder"

include QueryBuilder::CQL::Operators # for operators like cql_gt, cql_lte below.

table = QueryBuilder::CQL.keyspace(:auth).table(:users)

statement = table
  .select(:id, :role)
  .select(name: :user)
  .where(id: cql_gt(1))
  .where(id: cql_lte(4))
  .using(consistency: :quorum)
  .limit(3)
# => #<QueryBuilder::CQL::Statements::Select ...>

statement.to_s
# => "SELECT id, role, user AS name FROM auth.users WHERE id > 1 AND id <= 4 USING consistency = 'quorum' LIMIT 3;"

See the list of all supported contexts, statements and operators.

The gem doesn't depend on any specific Cassandra driver. It could be used to extend official Datastax driver with features of CQL building.

It doesn't validate CQL statements, leaving this to either driver or Cassandra database.

Installation

Add this line to your application's Gemfile:

# Gemfile
gem "query_builder"

Then execute:

bundle

Or add it manually:

gem install query_builder

Compatibility

Tested under rubies compatible to MRI 1.9.3+.

Uses RSpec 3.0+ for testing and hexx-suit for dev/test tools collection.

Contributing

  • Read the STYLEGUIDE
  • Fork the project
  • Create your feature branch (git checkout -b my-new-feature)
  • Add tests for it
  • Commit your changes (git commit -am '[UPDATE] Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create a new Pull Request

License

See the MIT LICENSE.

FAQs

Package last updated on 18 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc