fixer-m / snowflake-db-net-client

Snowflake .NET Client
Apache License 2.0
51 stars 14 forks source link

Unable to deserialize date from the format YYYY-MM-DD hh:mm:ss[.nnnnnnn] #36

Closed nadjalla closed 1 year ago

nadjalla commented 1 year ago

Dates in datetime2 format (YYYY-MM-DD hh:mm:ss[.nnnnnnn]) failed to deserialize while using the mapper. QueryAsync<T>(sqlQuery) fail if T have DateTime property that have datetime2 in snowflake database

fixer-m commented 1 year ago

@nadjalla Hi! Sorry for a late response.

I don't see DateTime2 in Snowflake date-time types. Is it some sort of TIMESTAMP?

Check that you use correct C# types for mapping:

TIMESTAMP_TZ and TIMESTAMP_LTZ => DateTimeOffset TIMESTAMP_NTZ => DateTime

nadjalla commented 1 year ago

Thanks, I will check to make sure I'm using the right C# type