@causa/runtime-google 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/spanner/entity-manager.js +12 -3
- package/package.json +16 -16
|
@@ -293,9 +293,15 @@ let SpannerEntityManager = class SpannerEntityManager {
|
|
|
293
293
|
? optionsOrStatement
|
|
294
294
|
: {};
|
|
295
295
|
const sqlStatement = statement ?? optionsOrStatement;
|
|
296
|
-
const { entityType, requestOptions
|
|
296
|
+
const { entityType, requestOptions } = options;
|
|
297
|
+
let snapshot;
|
|
297
298
|
try {
|
|
298
|
-
|
|
299
|
+
let { transaction } = options;
|
|
300
|
+
if (!transaction) {
|
|
301
|
+
[snapshot] = await this.database.getSnapshot();
|
|
302
|
+
transaction = snapshot;
|
|
303
|
+
}
|
|
304
|
+
const stream = transaction.runStream({
|
|
299
305
|
...sqlStatement,
|
|
300
306
|
requestOptions,
|
|
301
307
|
json: true,
|
|
@@ -311,7 +317,10 @@ let SpannerEntityManager = class SpannerEntityManager {
|
|
|
311
317
|
}
|
|
312
318
|
catch (error) {
|
|
313
319
|
// If running in a transaction, the error will be caught by `snapshot()` or `transaction()`.
|
|
314
|
-
throw
|
|
320
|
+
throw !snapshot ? error : (convertSpannerToEntityError(error) ?? error);
|
|
321
|
+
}
|
|
322
|
+
finally {
|
|
323
|
+
snapshot?.end();
|
|
315
324
|
}
|
|
316
325
|
}
|
|
317
326
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@causa/runtime-google",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "An extension to the Causa runtime SDK (`@causa/runtime`), providing Google-specific features.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,46 +34,46 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@causa/runtime": "^1.4.0",
|
|
36
36
|
"@google-cloud/precise-date": "^5.0.0",
|
|
37
|
-
"@google-cloud/pubsub": "^5.2.
|
|
38
|
-
"@google-cloud/spanner": "^8.
|
|
37
|
+
"@google-cloud/pubsub": "^5.2.1",
|
|
38
|
+
"@google-cloud/spanner": "^8.3.1",
|
|
39
39
|
"@google-cloud/tasks": "^6.2.1",
|
|
40
|
-
"@grpc/grpc-js": "^1.14.
|
|
41
|
-
"@nestjs/common": "^11.1.
|
|
40
|
+
"@grpc/grpc-js": "^1.14.3",
|
|
41
|
+
"@nestjs/common": "^11.1.11",
|
|
42
42
|
"@nestjs/config": "^4.0.2",
|
|
43
|
-
"@nestjs/core": "^11.1.
|
|
43
|
+
"@nestjs/core": "^11.1.11",
|
|
44
44
|
"@nestjs/passport": "^11.0.5",
|
|
45
45
|
"@nestjs/terminus": "^11.0.0",
|
|
46
46
|
"class-transformer": "^0.5.1",
|
|
47
|
-
"class-validator": "^0.14.
|
|
48
|
-
"express": "^5.1
|
|
47
|
+
"class-validator": "^0.14.3",
|
|
48
|
+
"express": "^5.2.1",
|
|
49
49
|
"firebase-admin": "^13.6.0",
|
|
50
|
-
"jsonwebtoken": "^9.0.
|
|
50
|
+
"jsonwebtoken": "^9.0.3",
|
|
51
51
|
"passport-http-bearer": "^1.0.1",
|
|
52
52
|
"pino": "^9.14.0",
|
|
53
53
|
"reflect-metadata": "^0.2.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@nestjs/testing": "^11.1.
|
|
57
|
-
"@swc/core": "^1.15.
|
|
56
|
+
"@nestjs/testing": "^11.1.11",
|
|
57
|
+
"@swc/core": "^1.15.8",
|
|
58
58
|
"@swc/jest": "^0.2.39",
|
|
59
59
|
"@tsconfig/node20": "^20.1.8",
|
|
60
60
|
"@types/jest": "^30.0.0",
|
|
61
61
|
"@types/jsonwebtoken": "^9.0.10",
|
|
62
|
-
"@types/node": "^20.19.
|
|
62
|
+
"@types/node": "^20.19.27",
|
|
63
63
|
"@types/passport-http-bearer": "^1.0.42",
|
|
64
64
|
"@types/supertest": "^6.0.3",
|
|
65
65
|
"@types/uuid": "^11.0.0",
|
|
66
66
|
"dotenv": "^17.2.3",
|
|
67
|
-
"eslint": "^9.39.
|
|
67
|
+
"eslint": "^9.39.2",
|
|
68
68
|
"eslint-config-prettier": "^10.1.8",
|
|
69
69
|
"eslint-plugin-prettier": "^5.5.4",
|
|
70
70
|
"jest": "^30.2.0",
|
|
71
71
|
"jest-extended": "^7.0.0",
|
|
72
|
-
"pino-pretty": "^13.1.
|
|
72
|
+
"pino-pretty": "^13.1.3",
|
|
73
73
|
"rimraf": "^6.1.2",
|
|
74
|
-
"supertest": "^7.
|
|
74
|
+
"supertest": "^7.2.2",
|
|
75
75
|
"typescript": "^5.9.3",
|
|
76
|
-
"typescript-eslint": "^8.
|
|
76
|
+
"typescript-eslint": "^8.52.0",
|
|
77
77
|
"uuid": "^13.0.0"
|
|
78
78
|
}
|
|
79
79
|
}
|