clickhouse.rs
clickhouse.rs copied to clipboard
Support Dynamic data type
https://clickhouse.com/docs/en/sql-reference/data-types/dynamic
According to docs this is encoded as
<binary_encoded_data_type><value_in_binary_format_according_to_the_data_type>
So, it should lead to deserialize_any (to ask for the real type from the deserializer).
Then, it can be parsed into some new enum Dynamic { UInt64(u64), ... } (see serde_value::Value or serde_json::Value as references).
Btw the same type can be used after moving to Native or RowBinaryWithNamesAndTypes for any columns to solve https://github.com/ClickHouse/clickhouse-rs/issues/53 and https://github.com/ClickHouse/clickhouse-rs/issues/74
Moreover, we should also support BorrowedDynamic<'_> for borrowing queries. Otherwise, it's a huge load for an allocator.