- Fix logging with symbolized keys JSON
- Unknown formats return raw
Response::ResultSelt
like regular JSON query
- Added methods
statistics
, summary
, headers
and types
to Response::ResultSet
ClickHouse.connection.insert
now returns ClickHouse::Response::Summary
object
with methods headers
, summary
, written_rows
, written_bytes
, etc...
ClickHouse.connection.insert(columns: ["id"], values: [1])
now uses JSONCompactEachRow
by default
(to increase JSON serialization speed)
- Methods
insert_rows
and insert_compact
added to connection
- Added ability to pass object directly to insert like:
ClickHouse.connection.insert("table", {id: 1})
or
ClickHouse.connection.insert("table", [{id: 1})]
(for ruby < 3.0 use ClickHouse.connection.insert("table", [{id: 1}], {})
)
- 🔥 Added config option
json_serializer
(one of ClickHouse::Serializer::JsonSerializer
, ClickHouse::Serializer::JsonOjSerializer
)
- 🔥 Added config option
symbolize_keys
- 🔥 Added type serialization for INSERT statements, example below:
CREATE TABLE assets(visible Boolean, tags Array(Nullable(String))) ENGINE Memory
# cache table schema in a class variable
@schema = ClickHouse.connection.table_schema('assets')
# Json each row
ClickHouse.connection.insert('assets', @schema.serialize({'visible' => true, 'tags' => ['ruby']}))
# Json compact
ClickHouse.connection.insert('assets', columns: %w[visible tags]) do |buffer|
buffer << [
@schema.serialize_column("visible", true),
@schema.serialize_column("tags", ['ruby']),
]
end
- Fixed
Bigdecimal
casting with high precision
- Added nested
type casting like Array(Array(Array(Nullable(T))))
- Added
Map(T1, T2)
support
- Added
Tuple(T1, T2)
support
- Added support for
Faraday
v1 and v2
- Added support for
Oj
parser
- Time types return
Time
class instead of DateTime
for now
- PR Add option format for insert
- PR Support X-ClickHouse-Exception-Code header
- ISSUE Fix parameterized types parsing
- Added LowCardinality DDL support
- Fixed body logging with POST queries
- PR Add rows_before_limit_at_least to ResultSet
- PR Force JSON format by using "default_format" instead of modifying the query
- PR call logging middleware when an error is raised
- PR handle value returned as nil in float and integer types (case of Aggregate Function Combinators)
- PR Fix Faraday deprecation
- add support for 'WITH TOTALS' modifier in response
- send SQL in GET request's body #12
- add support of 'WITH TOTALS' on a resulting set
- fix decimal type casting #11
- add
ClickHouse.connection.add_index
, ClickHouse.connection.drop_index
- fix
DateTime
casting for queries like ClickHouse.connection.select_value('select NOW()')
- fix resulting set console inspection
- specify required ruby version #10
- fix ruby 2.7 warning
maybe ** should be added to the call
on ClickHouse.connection.databases
- added
ClickHouse.connection.explain("sql")
- added
ClickHouse.type_names(nullable: false)
- fixed
connection#create_table
column definitions
ClickHouse.add_type
now handles Nullable types automatically
- fix null logger for windows users
- added support for IPv4/IPv6 types
- Datetime64 field type support #3