Merged
Conversation
2a86b31 to
5fb2d86
Compare
5fb2d86 to
42bc515
Compare
42bc515 to
49abffe
Compare
vonzshik
reviewed
Nov 4, 2025
Including support for generic parameters Fixes #2252 # Conflicts: # src/Npgsql/NpgsqlDataReader.cs
49abffe to
c883e1b
Compare
NinoFloris
commented
Nov 5, 2025
| var isSequential = _isSequential; | ||
| var currentPosition = Buffer.ReadPosition; | ||
| State = ReaderState.InResult; | ||
| _isSequential = false; |
Member
Author
There was a problem hiding this comment.
To support reading generically we must allow the parameters to be read out of order to also support the two pass matching we do.
This is what originally led me down the road to an incorrect re-implementation.
NinoFloris
commented
Nov 5, 2025
| break; | ||
|
|
||
| // This set will also contain -1, but that's not a valid index so we can ignore it is included. | ||
| var matchedParameters = new HashSet<int>(parameterIndices); |
Member
Author
There was a problem hiding this comment.
We could leave the hashset out on low fieldcount as well, just relying on simd indexof on the array.
6140f56 to
55d17f4
Compare
vonzshik
approved these changes
Nov 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moved the output reading into the command itself and added support via a virtual for reading values as a generic type for generic parameters.
Probably want to add some tests for the latter, TODO.
Regarding
I've added commentary on why it exists, people likely depend on this behavior as well. An unfortunate holdover from when we didn't have positional parameters.
We also have a test depending on it https://github.com/npgsql/npgsql/blob/main/test/Npgsql.Tests/FunctionTests.cs#L119.
Note how the set consists of named parameters while the columns are unnamed.
Closes #2252