Skip to content

Commit

Permalink
fix: merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
alkatrivedi committed May 28, 2024
1 parent ad7894f commit d5a5091
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
13 changes: 1 addition & 12 deletions samples/batch-write.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,9 @@ async function main(
AlbumTitle: 'Total Junk',
});

const options = {
requestOptions: {
priority:
protos.google.spanner.v1.RequestOptions.Priority.PRIORITY_MEDIUM,
transactionTag: 'transaction-tag',
},
gaxOptions: {
timeout: 1000,
},
};

try {
database
.batchWrite([mutationGroups, mutationGroups1], options)
.batchWrite([mutationGroups, mutationGroups1])
.on('error', console.error)
.on('data', response => {
console.log('response: ', response);
Expand Down
6 changes: 3 additions & 3 deletions src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3218,7 +3218,7 @@ class Database extends common.GrpcServiceObject {
*/
batchWrite(
mutationGroups: MutationGroup[],
options: BatchWriteOptions
options?: BatchWriteOptions
): NodeJS.ReadableStream {
const proxyStream: Transform = through.obj();

Expand All @@ -3227,13 +3227,13 @@ class Database extends common.GrpcServiceObject {
proxyStream.destroy(err);
return;
}
const gaxOpts = extend(true, {}, options.gaxOptions);
const gaxOpts = extend(true, {}, options?.gaxOptions);
const reqOpts = Object.assign(
{} as spannerClient.spanner.v1.BatchWriteRequest,
{
session: session!.formattedName_!,
mutationGroups: mutationGroups.map(mg => mg.proto()),
requestOptions: options.requestOptions,
requestOptions: options?.requestOptions,
}
);
let dataReceived = false;
Expand Down

0 comments on commit d5a5091

Please sign in to comment.