-
Notifications
You must be signed in to change notification settings - Fork 112
Closed
Labels
api: spannerIssues related to the googleapis/nodejs-spanner API.Issues related to the googleapis/nodejs-spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- OS: OSX
- Node.js version: v18.16.0
- npm version: 9.5.1
@google-cloud/spannerversion: 6.12.0
Steps to reproduce
- Use Typescript
- Attempt to use batch transactions as shown in
samples/batch.js
const query = {
sql: `
select
*
from
${POST_TABLE_NAME}
`,
};
const [transaction] = await this.database.createBatchTransaction();
const partitions = transaction.createQueryPartitions(query);
- Get
tscerror:
domains/archive/post-service/src/post-service-spanner.repository.ts:274:11 - error TS2488: Type 'void' must have a '[Symbol.iterator]()' method that returns an iterator.
274 const [partitions] = await transaction.createQueryPartitions(query);
~~~~~~~~~~~~
domains/archive/post-service/src/post-service-spanner.repository.ts:274:44 - error TS2554: Expected 2 arguments, but got 1.
274 const [partitions] = await transaction.createQueryPartitions(query);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@google-cloud/spanner/build/src/batch-transaction.d.ts:111:39
111 createQueryPartitions(query: any, callback: any): void;
~~~~~~~~~~~~~
An argument for 'callback' was not provided.
The problem appears to be that your use of promisifyAll doesn't cause the appropriate method types to be included in the .d.ts file.
fabienjuif
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the googleapis/nodejs-spanner API.Issues related to the googleapis/nodejs-spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.