Skip to content

Client refactors#422

Draft
adespawn wants to merge 4 commits intoscylladb:mainfrom
adespawn:client-refactors
Draft

Client refactors#422
adespawn wants to merge 4 commits intoscylladb:mainfrom
adespawn:client-refactors

Conversation

@adespawn
Copy link
Copy Markdown
Contributor

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.

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.
@adespawn adespawn added this to the GA milestone Mar 27, 2026
@adespawn adespawn self-assigned this Mar 27, 2026
@adespawn adespawn modified the milestones: GA, 0.5.0 Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant