Support array form params for requestSnapshot/fetchSnapshot in TypeScript client#3768
Support array form params for requestSnapshot/fetchSnapshot in TypeScript client#3768tjenkinson wants to merge 1 commit intoelectric-sql:mainfrom
requestSnapshot/fetchSnapshot in TypeScript client#3768Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit 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 |
commit: |
There was a problem hiding this comment.
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.paramstype to accept bothRecord<\${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
requestSnapshotwith 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
b1a8aa4 to
a981875
Compare
requestSnapshot/fetchSnapshotrequestSnapshot/fetchSnapshot in TypeScript client
params.paramsalready supports the array form, and it would be useful if the where params for snapshots did too