View Source Ch.RowBinary (Ch v0.2.7)
Helpers for working with ClickHouse RowBinary
format.
Summary
Functions
Decodes RowBinaryWithNamesAndTypes
into rows.
Decodes RowBinary
into rows.
Encodes a single row to RowBinary
as iodata.
Encodes multiple rows to RowBinary
as iodata.
Functions
Decodes RowBinaryWithNamesAndTypes
into rows.
Example:
iex> decode_rows(<<1, 3, "1+1"::bytes, 5, "UInt8"::bytes, 2>>)
[[2]]
Decodes RowBinary
into rows.
Example:
iex> decode_rows(<<1>>, ["UInt8"])
[[1]]
Encodes a single row to RowBinary
as iodata.
Examples:
iex> encode_row([], [])
[]
iex> encode_row([1], ["UInt8"])
[1]
iex> encode_row([3, "hello"], ["UInt8", "String"])
[3, [5 | "hello"]]
Encodes multiple rows to RowBinary
as iodata.
Examples:
iex> encode_rows([], [])
[]
iex> encode_rows([[1]], ["UInt8"])
[1]
iex> encode_rows([[3, "hello"], [4, "hi"]], ["UInt8", "String"])
[3, [5 | "hello"], 4, [2 | "hi"]]