Link Search Menu Expand Document

ClickHouseDbHelper


This class implements IDbHelper for ClickHouse. It queries the system.columns system table, filtered by database and table, to build the list of DbField objects RepoDB uses internally to generate SQL statements. Nullability is derived from a column’s Nullable(...) type wrapper, and IsIdentity is always reported false — ClickHouse has no identity/auto-increment concept.

It is automatically registered by ClickHouseBootstrap — you do not need to instantiate it directly under normal use.

Properties

NameDescription
DbTypeResolverThe IResolver<string, Type> used to convert a ClickHouse column data type (e.g. Nullable(DateTime64(3))) into its equivalent .NET CLR type. Defaults to ClickHouseDbTypeNameToClientTypeResolver.

Methods

NameDescription
GetFields / GetFieldsAsyncReturns the list of DbField objects for the given table, sourced from system.columns.
GetScopeIdentity / GetScopeIdentityAsyncAlways throws NotSupportedException — ClickHouse has no session-wide scope identity, sequence, or auto-increment mechanism.

Usability

Only override this if you need a custom type resolver.

var dbHelper = new ClickHouseDbHelper(new MyCustomClickHouseDbTypeNameToClientTypeResolver());
DbHelperMapper.Add<ClickHouseConnection>(dbHelper, true);