DarkWanderer / ClickHouse.Client

.NET client for ClickHouse
MIT License
300 stars 58 forks source link

Any plans to support Nullable with Dapper? #307

Closed kboniadi closed 9 months ago

kboniadi commented 1 year ago

I'm getting this error when using the nullable type. This is my query:

class Test { [Required] [PrimaryKey(AutoIdentifier = false)] public int ID{ get; set; } public string Order{ get; set; } public DateTime LastCountDate{ get; set; } public bool? Flag{ get; set; } }

INSERT INTO iac.Test (ID,Order,LastCountDate,Flag) VALUES (@ID,@Order,@LastCountDate,@Flag)

ClickHouse.Client.ClickHouseServerException (0x00000030): Code: 48. DB::Exception: Serialization is not implemented for type Nothing: While executing ValuesBlockInputFormat. (NOT_IMPLEMENTED) (version 22.10.2.11 (official build))

Is this a problem with Dapper or the clickhouse client? If either, was wondering if anyone has discovered a work around.

DarkWanderer commented 1 year ago

It's a problem with Dapper not being aware of ClickHouse data structure intricacies. Does it work for you if you use ClickHouse parameter syntax? ({name:type})