Skip to content

Commit 96c4c6a

Browse files
Xevifbaldi6
authored andcommitted
[NO_TICKET] fix: run spanner relational queries sequential to prevent seqno errors (#10)
* fix: run spanner relational queries sequential to prevent seqno errors * fix: update package-lock
1 parent bd35ea8 commit 96c4c6a

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@streamyard/typeorm",
33
"private": true,
4-
"version": "0.3.16-1",
4+
"version": "0.3.16-2",
55
"description": "Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB, Spanner databases.",
66
"license": "MIT",
77
"readmeFilename": "README.md",

src/persistence/SubjectExecutor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,9 @@ export class SubjectExecutor {
525525
* Updates all given subjects in the database.
526526
*/
527527
protected async executeUpdateOperations(): Promise<void> {
528+
const isSpanner =
529+
this.queryRunner.connection.driver.options.type === "spanner"
530+
528531
const updateSubject = async (subject: Subject) => {
529532
if (!subject.identifier)
530533
throw new SubjectWithoutIdentifierError(subject)
@@ -646,7 +649,7 @@ export class SubjectExecutor {
646649
const remainingSubjects: Subject[] = []
647650

648651
for (const subject of this.updateSubjects) {
649-
if (subject.metadata.treeType === "nested-set") {
652+
if (subject.metadata.treeType === "nested-set" || isSpanner) {
650653
nestedSetSubjects.push(subject)
651654
} else {
652655
remainingSubjects.push(subject)

0 commit comments

Comments
 (0)