ClickHouseClient
ClickHouseClient copied to clipboard
Generic type function command.ExecuteScalarAsync<T> throws exception when database returns no rows (Nothing)
Description Generic type function command.ExecuteScalarAsync<T> throws exception when Db returns no rows (Nothing)
Example:
ClickHouseCommand command = Connection.CreateCommand();
...
command.ExecuteScalarAsync<T> // throws exception (Cast from DbNull to T) when Db returns no rows (Nothing)
For that reason we cannot properly use generic function like command.ExecuteScalarAsync<string/long/int?...>
Is it possible to map DbType.DbNull to simple Null, because DbType.DbNull cannot be casted to nullable<int, string...>