Skip to content

fix: createQueryPartition with query params #2244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 12, 2025

Conversation

surbhigarg92
Copy link
Contributor

@surbhigarg92 surbhigarg92 commented Mar 6, 2025

Create Query Partition with query params throw error, as params are encoded twice , once while creating partition and once while executing

const query = {
    sql: 'SELECT * FROM Singers where SingerId > @id',
    params: {
      id: 1200,
    },
  };

const [partitions] = await transaction.createQueryPartitions(query);
partitions.forEach(partition => {
    transaction.execute(partition).then(results => {
      const rows = results[0].map(row => row.toJSON());
      row_count += rows.length;
  });
});

BEGIN_COMMIT_OVERRIDE
fix: createQueryPartition with query params
END_COMMIT_OVERRIDE

@surbhigarg92 surbhigarg92 requested review from a team as code owners March 6, 2025 07:27
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: spanner Issues related to the googleapis/nodejs-spanner API. labels Mar 6, 2025
@surbhigarg92 surbhigarg92 added the automerge Merge the pull request once unit tests and other checks pass. label Mar 12, 2025
@gcf-merge-on-green gcf-merge-on-green bot merged commit 91f5afd into main Mar 12, 2025
20 of 21 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Mar 12, 2025
@gcf-merge-on-green gcf-merge-on-green bot deleted the queryPartitionWithParams branch March 12, 2025 08:18
@sakthivelmanii sakthivelmanii added the release-please:force-run To run release-please label Mar 12, 2025
@release-please release-please bot removed the release-please:force-run To run release-please label Mar 12, 2025
@parthea parthea added the release-please:force-run To run release-please label Mar 13, 2025
@release-please release-please bot removed the release-please:force-run To run release-please label Mar 13, 2025
@parthea parthea added the release-please:force-run To run release-please label Mar 13, 2025
@release-please release-please bot removed the release-please:force-run To run release-please label Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/nodejs-spanner API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants