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

CommandText should be an empty string by default #743

Closed
roji opened this issue Dec 4, 2019 · 3 comments
Closed

CommandText should be an empty string by default #743

roji opened this issue Dec 4, 2019 · 3 comments
Assignees
Labels

Comments

@roji
Copy link

roji commented Dec 4, 2019

As per the docs.

I'd also consider throwing if null is set, although that would be a slightly bigger breaking change.

@bgrainger bgrainger added the bug label Dec 4, 2019
@bgrainger
Copy link
Member

bgrainger commented Dec 5, 2019

I'd also consider throwing if null is set

It appears that only npgsql does this: https://mysql-net.github.io/AdoNetResults/#CommandText_is_coerced_to_empty_string

Most other drivers silently coerce null to "". (Sqlite leaves it as null.) This is also the general behaviour for DbConnection.ConnectionString, even for npgsql.

I plan to default to "" and coerce .CommandText = null to "".

@bgrainger bgrainger self-assigned this Dec 5, 2019
@roji
Copy link
Author

roji commented Dec 5, 2019

Makes sense.

@bgrainger
Copy link
Member

bgrainger commented Mar 7, 2020

Changed in 0.62.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants