All Projects → crate → crate_ruby

crate / crate_ruby

Licence: Apache-2.0 license
A Ruby client library for CrateDB.

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to crate ruby

activerecord-crate-adapter
Ruby on Rails ActiveRecord adapter for CrateDB
Stars: ✭ 27 (-12.9%)
Mutual labels:  ruby-library, ruby-gem, sql-database, cratedb
Ransack
Object-based searching.
Stars: ✭ 5,020 (+16093.55%)
Mutual labels:  ruby-library, ruby-gem
glimmer-dsl-opal
Glimmer DSL for Opal (Pure-Ruby Web GUI and Auto-Webifier of Desktop Apps)
Stars: ✭ 22 (-29.03%)
Mutual labels:  ruby-library, ruby-gem
glimmer-dsl-swt
Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)
Stars: ✭ 53 (+70.97%)
Mutual labels:  ruby-library, ruby-gem
glimmer-dsl-tk
Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library)
Stars: ✭ 26 (-16.13%)
Mutual labels:  ruby-library, ruby-gem
ruby terraform
A simple Ruby wrapper for invoking terraform commands.
Stars: ✭ 92 (+196.77%)
Mutual labels:  ruby-library, ruby-gem
Filestack Rails
Official Ruby on Rails plugin for Filestack File Picker that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
Stars: ✭ 220 (+609.68%)
Mutual labels:  ruby-gem
Jekyll Minifier
Jekyll HTML/XML/CSS/JS Minifier utilising yui-compressor, and htmlcompressor
Stars: ✭ 215 (+593.55%)
Mutual labels:  ruby-gem
Email address
The EmailAddress Gem to work with and validate email addresses.
Stars: ✭ 199 (+541.94%)
Mutual labels:  ruby-gem
Tty
Toolkit for developing sleek command line apps.
Stars: ✭ 2,329 (+7412.9%)
Mutual labels:  ruby-gem
The-Ruby-Workshop
A New, Interactive Approach to Learning Ruby
Stars: ✭ 26 (-16.13%)
Mutual labels:  ruby-library
Discogs
A Ruby wrapper of the Discogs.com API
Stars: ✭ 195 (+529.03%)
Mutual labels:  ruby-gem
Caxlsx
xlsx generation with charts, images, automated column width, customizable styles and full schema validation. Axlsx excels at helping you generate beautiful Office Open XML Spreadsheet documents without having to understand the entire ECMA specification. Check out the README for some examples of how easy it is. Best of all, you can validate your xlsx file before serialization so you know for sure that anything generated is going to load on your client's machine.
Stars: ✭ 221 (+612.9%)
Mutual labels:  ruby-gem
iyzipay-ruby
iyzipay api ruby client
Stars: ✭ 37 (+19.35%)
Mutual labels:  ruby-library
iosdevices
iOS device model translation from Apple device types.
Stars: ✭ 14 (-54.84%)
Mutual labels:  ruby-library
open dota api
Ruby client for Dota 2 from OpenDotaAPI
Stars: ✭ 19 (-38.71%)
Mutual labels:  ruby-library
Dry Schema
Coercion and validation for data structures
Stars: ✭ 249 (+703.23%)
Mutual labels:  ruby-gem
gcra-ruby
Generic cell rate algorithm (leaky bucket) implementation for rate limiting
Stars: ✭ 49 (+58.06%)
Mutual labels:  ruby-gem
minimal-ruby-project
A minimal Ruby project template
Stars: ✭ 40 (+29.03%)
Mutual labels:  ruby-library
Api Fuzzer
API Fuzzer which allows to fuzz request attributes using common pentesting techniques and lists vulnerabilities
Stars: ✭ 238 (+667.74%)
Mutual labels:  ruby-gem

CrateDB Ruby Client

Build Status Gem Version Total downloads

A Ruby client library for the CrateDB HTTP interface.

  • Query execution support.
  • DDL command and schema introspection shortcuts.
  • Support for BLOB tables.
  • Foundation for the activerecord-crate-adapter.

Prerequisites

You will need Ruby 2.0 or greater.

Installation

The CrateDB Ruby client is available on RubyGems.org, see crate_ruby on RubyGems.org.

To use it, add this line to your application's Gemfile:

gem 'crate_ruby'

Or install it manually:

gem install crate_ruby

Synopsis

Set up the client.

require 'crate_ruby'

client = CrateRuby::Client.new()

Execute SQL queries.

result = client.execute("SELECT * FROM posts")
 => #<CrateRuby::ResultSet:0x00000002a9c5e8 @rowcount=1, @duration=5>

result.each do |row|
  puts row.inspect
end
 => [1, "test", 5]

result.cols
 => ["id", "my_column", "my_integer_col"]

Perform parameter substitution.

client.execute(
    "INSERT INTO posts (id, title, tags) VALUES (\$1, \$2, \$3)",
    [1, "My life with crate", ['awesome', 'cool']])

Manipulate BLOBs.

require 'digest'

digest = Digest::SHA1.file(file_path).hexdigest

# upload
f = File.read(file_path)
client.blob_put(table_name, digest, f)

# download
data = client.blob_get(table_name, digest)
open(file_path, "wb") do |file|
  file.write(data)
end

# deletion
client.blob_delete(table_name, digest)

A default schema can be set by passing in the schema name.

CrateRuby::Client.new(['localhost:4200'], schema: 'my_schema')

Authentication credentials can be passed to the client if needed.

CrateRuby::Client.new(['localhost:4200'], username: 'foo', password: 'supersecret')

SSL can be enabled.

CrateRuby::Client.new(['localhost:4200'], ssl: true)

Notes

See also CrateDB examples for Ruby for a basic example program, which exercises both the crate_ruby driver, as well as Ruby's canonical pg driver.

Contributing

This project is primarily maintained by Crate.IO GmbH, but we welcome community contributions!

See the developer docs and the contribution docs for more information.

Help

Looking for more help?

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].