Skip to content
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

Closed
mgravell opened this issue Nov 15, 2023 · 7 comments
Assignees
Labels
feature status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. status-triage_done Initial triage done, will be further handled by the driver team

Comments

@mgravell
Copy link

Currently DbType is a basic auto-implemented property: https://github.com/snowflakedb/snowflake-connector-net/blob/master/Snowflake.Data/Client/SnowflakeDbParameter.cs#L37

This 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 as AnsiString

@github-actions github-actions bot changed the title Parameter DbType should track explicit assignment rather than hard default to AnsiString SNOW-970857: Parameter DbType should track explicit assignment rather than hard default to AnsiString Nov 15, 2023
@sfc-gh-dszmolka
Copy link
Contributor

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.

@amis92
Copy link

amis92 commented Nov 28, 2023

@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.

@sfc-gh-dszmolka sfc-gh-dszmolka added the status-in_progress Issue is worked on by the driver team label Nov 28, 2023
@sfc-gh-dszmolka
Copy link
Contributor

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 !

@sfc-gh-dszmolka sfc-gh-dszmolka added the status-triage_done Initial triage done, will be further handled by the driver team label Mar 12, 2024
@sfc-gh-dszmolka
Copy link
Contributor

PR in review #889

@sfc-gh-dszmolka sfc-gh-dszmolka added status-pr_pending_merge A PR is made and is under review and removed status-in_progress Issue is worked on by the driver team labels Mar 27, 2024
@sfc-gh-dszmolka
Copy link
Contributor

PR merged and fix will be part of the 2024 April release, towards the end of month

@sfc-gh-dszmolka sfc-gh-dszmolka added status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. and removed status-pr_pending_merge A PR is made and is under review labels Apr 2, 2024
@sfc-gh-dszmolka
Copy link
Contributor

sfc-gh-dszmolka commented Jun 24, 2024

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

@sfc-gh-dszmolka
Copy link
Contributor

fix released with Snowflake .NET driver version v4.0.0 in July 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

5 participants