Simple client for Yandex Clickhouse.
Note: Right now this gem is not production-ready!
Add this line to your application's Gemfile:
gem 'clickhouse-client', github: 'h3xby/clickhouse-client-ruby'
Create config/clickhouse.yml and setup connection params to Clickhouse:
development:
url: http://127.0.0.1:8123/?database=development
test:
url: http://127.0.0.1:8123/?database=test
production:
url: <%= ENV['CLICKHOUSE_URL'] %>
After this you can access to client:
Clickhouse.client
This gem include simple query builder:
Clickhouse.client.build
.select('hit_id')
.from('hits')
.where(created_at: Date.today)
.execute
It supports where
, from
, select
, group
, having
, join
, limit
, offset
operations.