-
Notifications
You must be signed in to change notification settings - Fork 140
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
SNOW-970857: Parameter DbType should track explicit assignment rather than hard default to AnsiString #813
Comments
hi and thank you for raising this issue and especially for the detailed description of how this would be useful ! we'll take a look at this enhancement request. |
@sfc-gh-dszmolka please prioritize this, we're forced to use no longer supported versions (1.x) due to this. I'd classify this as a bug, as a matter of fact. |
Sure - let us sync internally and the driver team can decide what's the best to move forward with this issue. Thank you for bearing with us ! |
PR in review #889 |
PR merged and fix will be part of the 2024 April release, towards the end of month |
Will update this thread once more information is known about the next upcoming major release of the .NET driver which will carry this fix. edit: confirming with Product team; release should be available by mid-July 2024 |
fix released with Snowflake .NET driver version v4.0.0 in July 2024 |
Currently
DbType
is a basic auto-implemented property: https://github.com/snowflakedb/snowflake-connector-net/blob/master/Snowflake.Data/Client/SnowflakeDbParameter.cs#L37This causes problems because it defaults to
AnsiString
(value zero) (because)To complicate things: multiple providers have types where setting the
DbType
is actively discouraged, because they will use additional types internally when assigned. This means that provider-agnostic tools (think "Dapper") actively choose not to set this property in those cases, which causes problems.The way most providers do this is to track explicit assignment; if it has never actively been assigned a value, then the
get
value is inferred from the.Value
(or other mechanisms).Examples:
I suggest this provider should do something similar, to avoid the problem where if
DbType
is not set, things are sent asAnsiString
The text was updated successfully, but these errors were encountered: