Link Search Menu Expand Document

ClickHouseDbTypeNameToClientTypeResolver


This IResolver<string, Type> implementation converts a ClickHouse column data type name — as returned by system.columns.type — into its equivalent .NET CLR type. It first unwraps any Nullable(...)/LowCardinality(...) wrapper and parameterized suffix (e.g. FixedString(16), DateTime64(3)), then maps the base type name, for example: Int8/Int16/Int32/Int64sbyte/short/int/long, UInt8/UInt16/UInt32/UInt64byte/ushort/uint/ulong, Float32/Float64float/double, String/FixedStringstring, Date/DateTime/DateTime64DateTime, Decimal/Decimal32/64/128/256decimal, UUIDGuid, and Boolbool. It is the default DbTypeResolver used by ClickHouseDbHelper.

Usability

var resolver = new ClickHouseDbTypeNameToClientTypeResolver();
var clrType = resolver.Resolve("Nullable(UInt64)"); // typeof(ulong)