Closed roee88 closed 7 months ago
Does Microsoft.Data.Sqlite
allow it?
Does
Microsoft.Data.Sqlite
allow it?
Yes
What about other database providers such as SqlClient and Npgsql?
I don't know, does it really matter? The main claim here isn't that others allow it so this library should too, but rather that there are valid use cases for it, as I mentioned.
Edit: Unreferenced_named_parameter_works unit test in Npgsql shows that it's allowed there too.
This is now live on NuGet
Description
Avoid failing when more-than-expected parameters are specified in a parameterized query. For example, if a user specifies 5 named parameters but the query only uses 3, don't fail because there are use cases where this is expected.
Example use cases that will be enabled by this change:
Desired behavior
System.Data.SQLite behavior is as expected and accepts the additional
y
parameterCurrent behavior
A
System.InvalidOperationException
is thrown