Skip to content

Commit 5f88552

Browse files
authored
[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 e9baaa8 commit 5f88552

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
@@ -524,6 +524,9 @@ export class SubjectExecutor {
524524
* Updates all given subjects in the database.
525525
*/
526526
protected async executeUpdateOperations(): Promise<void> {
527+
const isSpanner =
528+
this.queryRunner.connection.driver.options.type === "spanner"
529+
527530
const updateSubject = async (subject: Subject) => {
528531
if (!subject.identifier)
529532
throw new SubjectWithoutIdentifierError(subject)
@@ -645,7 +648,7 @@ export class SubjectExecutor {
645648
const remainingSubjects: Subject[] = []
646649

647650
for (const subject of this.updateSubjects) {
648-
if (subject.metadata.treeType === "nested-set") {
651+
if (subject.metadata.treeType === "nested-set" || isSpanner) {
649652
nestedSetSubjects.push(subject)
650653
} else {
651654
remainingSubjects.push(subject)

0 commit comments

Comments
 (0)