- RowBinary: truncate NaiveDateTime resulting from DateTime64 #297
- Add support for
JSON(...)(JSON with options) type #309 - RowBinary: de- and encode dynamic JSON #296
- use gregorian seconds for naive datetime encoding in RowBinary (it's faster this way) #311
- use
DateTime.to_unix/2+DateTime.to_naive/1for naive datetime decoding in RowBinary #313 - allow non-UTC timezones for DateTime64 RowBinary encoding #315
- use gregorian days in RowBinary dates #318
Warning
This version drops Elixir v1.14 support
- use
disconnect_and_retry(added in DBConnection v2.9.0) instead ofdisconnectfor connection errors #292
-
added support for
multipart/form-datain queries: #290 -- which allows bypassing URL length limits sometimes imposed by reverse proxies when sending queries with many parameters.⚠️ This is currently opt-in per query⚠️ Global support for the entire connection pool is planned for a future release.
Usage
Pass
multipart: truein the options list forCh.query/4# Example usage Ch.query(pool, "SELECT {a:String}, {b:String}", %{"a" => "A", "b" => "B"}, multipart: true)
View raw request format reference
POST / HTTP/1.1 content-length: 387 host: localhost:8123 user-agent: ch/0.6.2-dev x-clickhouse-format: RowBinaryWithNamesAndTypes content-type: multipart/form-data; boundary="ChFormBoundaryZZlfchKTcd8ToWjEvn66i3lAxNJ_T9dw" --ChFormBoundaryZZlfchKTcd8ToWjEvn66i3lAxNJ_T9dw content-disposition: form-data; name="param_a" A --ChFormBoundaryZZlfchKTcd8ToWjEvn66i3lAxNJ_T9dw content-disposition: form-data; name="param_b" B --ChFormBoundaryZZlfchKTcd8ToWjEvn66i3lAxNJ_T9dw content-disposition: form-data; name="query" select {a:String}, {b:String} --ChFormBoundaryZZlfchKTcd8ToWjEvn66i3lAxNJ_T9dw--
- handle disconnect during stream #283
-
added automatic decoding to
Ch.stream/4when usingRowBinaryWithNamesAndTypesformat: #277.Previously, this function returned raw bytes.
To restore the previous behavior (raw bytes/no automatic decoding), pass
decode: falsein the options (fourth argument).Example of required change to preserve the previous behavior
# before, no decoding by default DBConnection.run(pool, fn conn -> conn |> Ch.stream("select number from numbers(10)") |> Enum.into([]) end) # after, to keep the same behaviour add `decode: false` option DBConnection.run(pool, fn conn -> conn |> Ch.stream("select number from numbers(10)", _params = %{}, decode: false) |> Enum.into([]) end)
Queries using other explicit formats like
CSVWithNamesare unaffected and can remain as they are.Examples of unaffected queries
DBConnection.run(pool, fn conn -> conn |> Ch.stream("select number from numbers(10) format CSVWithNames") |> Enum.into([]) end) DBConnection.run(pool, fn conn -> conn |> Ch.stream("select number from numbers(10)", _params = %{}, format: "CSVWithNames") |> Enum.into([]) end)
- fix type decoding for strings containing newlines #278
- fix internal type ordering in Variant #275
- fix version check for adding JSON settings #274
- allow
nilin params #268
- make Dynamic usable in Ecto schemas #267
- fix column decoding when count exceeds 127 #257
- restrict to Ecto v3.13
- fix column decoding when count exceeds 127 #257
- restrict to Ecto v3.12
- fix type decoding when type name exceeds 127 bytes #248
- add column names to
%Ch.Result{}#243
- gracefully handle
connection: closedresponse from server #211 - allow non-UTC
DateTime.t()in query params #223 - allow non-UTC
DateTime.t()when encoding RowBinary #225 - add
:typestoquery_optiontypespec #234 - handle missing
written_rowsin insert #236
- handle missing
written_rowsin insert #236 (backported)
- catch all errors in
connect/1to avoid triggering Supervisor #209
- support named tuples #197
- fix query encoding for datetimes where the microseconds value starts with zeroes
~U[****-**-** **:**:**.0*****]#175
- add
:datain%Ch.Result{}#159 - duplicate
Ch.Result.datainCh.Result.rowsfor backwards compatibility #160 - make
Ch.streamemitCh.Result.tinstead ofMint.Types.response#161 - make
Ch.streamcollectable #162
- fix socket leak on failed handshake #153
- fix query encoding for datetimes with zeroed microseconds
~U[****-**-** **:**:**.000000]#138
- fix array casts with
Chsubtype #118
- move loading and dumping from
Chtype to the adapter #112
- simplify types, again...
- refactor types in
Ch.RowBinary#88
- replace
{:raw, data}withencode: falseoption, add:decodeoption #42
- support
:rawoption inChtype #84
- relax deps versions
- fix varint encoding
- support RowBinaryWithNamesAndTypes
- add Map(K,V) support in Ch Ecto type
- fix query param encoding like Array(Date)
- add more types support in Ch Ecto type: tuples, ipv4, ipv6, geo
- actually support negative
Enumvalues
- support negative
Enumvalues, fixEnum16encoding
- support
Enum8andEnum16encoding
- cleanup published docs