Draft
Conversation
This class aims to replace the current mess of types that were used for representing prepared statement information across the JS code. This will be useful in the next commit(s) that will introduce named parameters.
This commit introduces support for named parameters in prepared statements.
The desired behavior is based on DSx integration tests:
When an object is passed as params instead of an array, the driver
maps parameter names to positional indices using column metadata
from prepared info. Lookup is case-insensitive; extra properties not
matching any column are silently ignored. Supported in execute(),
eachRow()/stream() (paged), and batch() with { prepare: true }.
This commits extends the result set class to keep inner wrapped paged state. This will be used in the refactors done in the following commits
This refactor merges rustyPaged with rustyExecute. Those two function had a lot of common code, with addition for handling paging in the first one. With the refactor I also slightly improve type documentation for those functions.
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.
This PR is done on top of #421. If you want to review this PR, look at the:
commits.
The main motivation for this refactor is that in the integration tests, we only tested the rusty paged version of the internal interface. This increases the chance of improper updates to the code, as we need to remember to update 2 places instead of 1, and we do not need to unnecessarily extend integration tests to handle both branches.