NAME

DBD::ClickHouse::Format - TabSeparated and RowBinary codecs for DBD::ClickHouse

DESCRIPTION

Internal helpers for DBD::ClickHouse 0.11.

tsv_unescape, tsv_escape, tsv_split, tsv_split_lines

ClickHouse TabSeparated escaping. \N is NULL. Fields are UTF-8 decoded when they contain high bytes; bytes that are not valid UTF-8 are kept as bytes (JSON output would have replaced them).

tsv_cell, tsv_build

Insert body construction. Plain rows are joined with tabs and checked with one tr///; rows with NULLs, references, or characters that need escaping take the per-cell path. Array and hash references are written as ClickHouse quoted literals ([1,'a'], {'k':1}, tuples as (1,'a') when typed).

rowbinary_header, rowbinary_decoder

RowBinaryWithNamesAndTypes results. Supported column types: (U)Int8-64, Float32/64, Bool, String, FixedString, Date, Date32, DateTime, DateTime64, UUID, IPv4, Enum8/16, Decimal32/64 (and Decimal(P,S) with P <= 18), with Nullable and LowCardinality wrappers. Anything else returns undef so the driver falls back to TabSeparated or JSON.

DateTime values are formatted in the column's zone, or the server zone, to the same YYYY-MM-DD hh:mm:ss strings the text formats return, unless epoch_dates is set.