No commit activity in last 3 years
No release in over 3 years
Sequel JDBC adapter for Crate
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 1.1.1.0
~> 4.14.0
 Project Readme

sequel-jdbc-crate

Adapter for Sequel using the JDBC driver for connecting to Crate.

Usage

Example how to connect

require 'sequel'
require 'logger'
DB = Sequel.connect('jdbc:crate://localhost:4300')
DB.loggers << ::Logger.new($stdout)

Examples

Please take a look at the examples.rb file for all the examples. If you get Java::IoCrateActionSql::SQLActionException: org.elasticsearch.index.shard.IllegalIndexShardStateException then just run the command again.

To run the examples with RVM

$ rvm jruby@sequel-jdbc-crate --create
$ bundle install --path vendor --binstubs
$ bundle exec ruby -Ilib examples/basic.rb
$ bundle exec ruby -Ilib examples/models.rb

Exceptions

Currently, raised exception class is Java::IoCrateActionSql::SQLActionException

def safe_drop(table)
  DB.execute(%Q(DROP TABLE "#{table}"))
rescue Java::IoCrateActionSql::SQLActionException
  #no problem,the table didnt exist
end

License

Crate JDBC is distributed under the Apache License 2.0, see LICENSE.txt.