Module: ChConnect

Defined in:
lib/ch_connect.rb,
lib/ch_connect/config.rb,
lib/ch_connect/version.rb,
lib/ch_connect/response.rb,
lib/ch_connect/connection.rb,
lib/ch_connect/null_instrumenter.rb,
ext/ch_connect_native/ch_connect_native.c

Overview

Ruby client for ClickHouse database with Native format support.

Examples:

Basic usage

ChConnect.configure do |config|
  config.host = "localhost"
  config.port = 9000
end

conn = ChConnect::Connection.new
response = conn.query("SELECT 1")

Defined Under Namespace

Classes: Config, Connection, ConnectionError, Error, NativeClient, NullInstrumenter, QueryError, Response, UnsupportedTypeError

Constant Summary collapse

VERSION =
"0.3.0"

Class Method Summary collapse

Class Method Details

.configConfig

Returns the global configuration instance.

Returns:

  • (Config)

    the configuration instance



34
35
36
# File 'lib/ch_connect.rb', line 34

def self.config
  @config ||= Config.new
end

.configure {|Config| ... } ⇒ void

This method returns an undefined value.

Yields the global configuration for modification.

Yields:

  • (Config)

    the configuration instance



42
43
44
# File 'lib/ch_connect.rb', line 42

def self.configure
  yield config
end