-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to cast object of type 'ClickHouse.Client.Numerics.ClickHouseDecimal' to type 'System.Nullable`1[System.Decimal] #340
Comments
Hi, Yes, it seems to be a compatibility issue between As an interim solution, does using a handler like:
improve the situation for you? |
I think that could work. For now we went to manual mapping because Dapper doesn't have a per query type handler system and we have way to many places do double check for that instead of writing out like 15 lines of mapping code. This also allowed us access to the QueryStats. |
What I'm suggesting is to add this handler to your code
This is a static operation and should not require using manual mapping. As another workaround, you can try using |
I understand that, this is an existing code base connected to more than Clickhouse with Dapper and taking over the default mapping for all Dapper queries is more of a risk (and testing effort) then I'm willing to take versus mapping out a few properties. I'll check out the connection string change too. I've attempted a fork but 4.6.2 isn't installed on my laptop and I can't get a failing unit test yet for the |
Version: 6.7.2
When using Dapper's
connection.QueryAsync<ModelClass>(commandDefintion)
with a property ofdecimal?
, the below error gets thrown on mapping. Clickhouse table schema includes aNullable(Decimal(18, 2))
property that has it's value set to123.00
The text was updated successfully, but these errors were encountered: