Skip to content

Conversation

@tjenkinson
Copy link
Contributor

params.params already supports the array form, and it would be useful if the where params for snapshots did too

@tjenkinson tjenkinson marked this pull request as ready for review January 24, 2026 22:14
Copilot AI review requested due to automatic review settings January 24, 2026 22:14
@coderabbitai
Copy link

coderabbitai bot commented Jan 24, 2026

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 24, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@electric-sql/react@3768
npm i https://pkg.pr.new/@electric-sql/client@3768
npm i https://pkg.pr.new/@electric-sql/y-electric@3768

commit: a981875

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends array form parameter support to requestSnapshot and fetchSnapshot methods in the TypeScript client. Previously, only the ShapeStream constructor's params supported arrays; now SubsetParams (used for snapshots) also supports the array form for positional WHERE clause parameters.

Changes:

  • Updated SubsetParams.params type to accept both Record<\${number}`, string>(object form) andstring[]` (array form)
  • Refactored parameter conversion logic to handle array-to-object conversion consistently for both ShapeStream and snapshot params
  • Added test coverage for requestSnapshot with array form params

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/typescript-client/src/types.ts Updated SubsetParams type to allow array form for params field, matching PostgresParams signature
packages/typescript-client/src/client.ts Refactored convertWhereParamsToObj to accept params directly; updated toInternalParams to handle conversion; updated call sites for consistency
packages/typescript-client/test/client.test.ts Added test case for requestSnapshot with array form params to verify the new functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

`params.params` already supports the array form, and it would be useful if the where params for snapshots did too
@tjenkinson tjenkinson force-pushed the array-form-params-request-snapshot-ts branch from b1a8aa4 to a981875 Compare January 24, 2026 22:22
@tjenkinson tjenkinson changed the title Support array form params for requestSnapshot/fetchSnapshot Support array form params for requestSnapshot/fetchSnapshot in TypeScript client Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant