@google-cloud/spanner 7.9.0 → 7.10.0
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/CHANGELOG.md +25 -0
- package/build/protos/google/spanner/admin/database/v1/backup.proto +17 -0
- package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +227 -0
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +60 -0
- package/build/protos/google/spanner/executor/v1/cloud_executor.proto +13 -0
- package/build/protos/google/spanner/v1/spanner.proto +78 -0
- package/build/protos/protos.d.ts +1416 -119
- package/build/protos/protos.js +3011 -2
- package/build/protos/protos.json +382 -11
- package/build/src/database.js +25 -8
- package/build/src/partial-result-stream.d.ts +2 -0
- package/build/src/partial-result-stream.js +11 -0
- package/build/src/transaction.d.ts +1 -0
- package/build/src/transaction.js +2 -0
- package/build/src/v1/database_admin_client.d.ts +240 -0
- package/build/src/v1/database_admin_client.js +256 -0
- package/build/src/v1/database_admin_client_config.json +25 -0
- package/build/src/v1/database_admin_proto_list.json +1 -0
- package/build/src/v1/spanner_client.d.ts +22 -0
- package/build/src/v1/spanner_client.js +14 -6
- package/build/src/v1/spanner_executor_proxy_client.d.ts +42 -0
- package/build/src/v1/spanner_executor_proxy_client.js +59 -2
- package/build/src/v1/spanner_executor_proxy_proto_list.json +1 -0
- package/package.json +2 -2
package/build/protos/protos.json
CHANGED
|
@@ -1720,6 +1720,14 @@
|
|
|
1720
1720
|
"options": {
|
|
1721
1721
|
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
1722
1722
|
}
|
|
1723
|
+
},
|
|
1724
|
+
"backupSchedules": {
|
|
1725
|
+
"rule": "repeated",
|
|
1726
|
+
"type": "string",
|
|
1727
|
+
"id": 14,
|
|
1728
|
+
"options": {
|
|
1729
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
1730
|
+
}
|
|
1723
1731
|
}
|
|
1724
1732
|
},
|
|
1725
1733
|
"nested": {
|
|
@@ -2076,6 +2084,9 @@
|
|
|
2076
2084
|
}
|
|
2077
2085
|
}
|
|
2078
2086
|
},
|
|
2087
|
+
"FullBackupSpec": {
|
|
2088
|
+
"fields": {}
|
|
2089
|
+
},
|
|
2079
2090
|
"OperationProgress": {
|
|
2080
2091
|
"fields": {
|
|
2081
2092
|
"progressPercent": {
|
|
@@ -2153,6 +2164,209 @@
|
|
|
2153
2164
|
"POSTGRESQL": 2
|
|
2154
2165
|
}
|
|
2155
2166
|
},
|
|
2167
|
+
"BackupScheduleSpec": {
|
|
2168
|
+
"oneofs": {
|
|
2169
|
+
"scheduleSpec": {
|
|
2170
|
+
"oneof": [
|
|
2171
|
+
"cronSpec"
|
|
2172
|
+
]
|
|
2173
|
+
}
|
|
2174
|
+
},
|
|
2175
|
+
"fields": {
|
|
2176
|
+
"cronSpec": {
|
|
2177
|
+
"type": "CrontabSpec",
|
|
2178
|
+
"id": 1
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
},
|
|
2182
|
+
"BackupSchedule": {
|
|
2183
|
+
"options": {
|
|
2184
|
+
"(google.api.resource).type": "spanner.googleapis.com/BackupSchedule",
|
|
2185
|
+
"(google.api.resource).pattern": "projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}",
|
|
2186
|
+
"(google.api.resource).plural": "backupSchedules",
|
|
2187
|
+
"(google.api.resource).singular": "backupSchedule"
|
|
2188
|
+
},
|
|
2189
|
+
"oneofs": {
|
|
2190
|
+
"backupTypeSpec": {
|
|
2191
|
+
"oneof": [
|
|
2192
|
+
"fullBackupSpec"
|
|
2193
|
+
]
|
|
2194
|
+
}
|
|
2195
|
+
},
|
|
2196
|
+
"fields": {
|
|
2197
|
+
"name": {
|
|
2198
|
+
"type": "string",
|
|
2199
|
+
"id": 1,
|
|
2200
|
+
"options": {
|
|
2201
|
+
"(google.api.field_behavior)": "IDENTIFIER"
|
|
2202
|
+
}
|
|
2203
|
+
},
|
|
2204
|
+
"spec": {
|
|
2205
|
+
"type": "BackupScheduleSpec",
|
|
2206
|
+
"id": 6,
|
|
2207
|
+
"options": {
|
|
2208
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
2209
|
+
}
|
|
2210
|
+
},
|
|
2211
|
+
"retentionDuration": {
|
|
2212
|
+
"type": "google.protobuf.Duration",
|
|
2213
|
+
"id": 3,
|
|
2214
|
+
"options": {
|
|
2215
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
2216
|
+
}
|
|
2217
|
+
},
|
|
2218
|
+
"encryptionConfig": {
|
|
2219
|
+
"type": "CreateBackupEncryptionConfig",
|
|
2220
|
+
"id": 4,
|
|
2221
|
+
"options": {
|
|
2222
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
2223
|
+
}
|
|
2224
|
+
},
|
|
2225
|
+
"fullBackupSpec": {
|
|
2226
|
+
"type": "FullBackupSpec",
|
|
2227
|
+
"id": 7
|
|
2228
|
+
},
|
|
2229
|
+
"updateTime": {
|
|
2230
|
+
"type": "google.protobuf.Timestamp",
|
|
2231
|
+
"id": 9,
|
|
2232
|
+
"options": {
|
|
2233
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
},
|
|
2238
|
+
"CrontabSpec": {
|
|
2239
|
+
"fields": {
|
|
2240
|
+
"text": {
|
|
2241
|
+
"type": "string",
|
|
2242
|
+
"id": 1,
|
|
2243
|
+
"options": {
|
|
2244
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
2245
|
+
}
|
|
2246
|
+
},
|
|
2247
|
+
"timeZone": {
|
|
2248
|
+
"type": "string",
|
|
2249
|
+
"id": 2,
|
|
2250
|
+
"options": {
|
|
2251
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
2252
|
+
}
|
|
2253
|
+
},
|
|
2254
|
+
"creationWindow": {
|
|
2255
|
+
"type": "google.protobuf.Duration",
|
|
2256
|
+
"id": 3,
|
|
2257
|
+
"options": {
|
|
2258
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
},
|
|
2263
|
+
"CreateBackupScheduleRequest": {
|
|
2264
|
+
"fields": {
|
|
2265
|
+
"parent": {
|
|
2266
|
+
"type": "string",
|
|
2267
|
+
"id": 1,
|
|
2268
|
+
"options": {
|
|
2269
|
+
"(google.api.field_behavior)": "REQUIRED",
|
|
2270
|
+
"(google.api.resource_reference).type": "spanner.googleapis.com/Database"
|
|
2271
|
+
}
|
|
2272
|
+
},
|
|
2273
|
+
"backupScheduleId": {
|
|
2274
|
+
"type": "string",
|
|
2275
|
+
"id": 2,
|
|
2276
|
+
"options": {
|
|
2277
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
2278
|
+
}
|
|
2279
|
+
},
|
|
2280
|
+
"backupSchedule": {
|
|
2281
|
+
"type": "BackupSchedule",
|
|
2282
|
+
"id": 3,
|
|
2283
|
+
"options": {
|
|
2284
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
},
|
|
2289
|
+
"GetBackupScheduleRequest": {
|
|
2290
|
+
"fields": {
|
|
2291
|
+
"name": {
|
|
2292
|
+
"type": "string",
|
|
2293
|
+
"id": 1,
|
|
2294
|
+
"options": {
|
|
2295
|
+
"(google.api.field_behavior)": "REQUIRED",
|
|
2296
|
+
"(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule"
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
}
|
|
2300
|
+
},
|
|
2301
|
+
"DeleteBackupScheduleRequest": {
|
|
2302
|
+
"fields": {
|
|
2303
|
+
"name": {
|
|
2304
|
+
"type": "string",
|
|
2305
|
+
"id": 1,
|
|
2306
|
+
"options": {
|
|
2307
|
+
"(google.api.field_behavior)": "REQUIRED",
|
|
2308
|
+
"(google.api.resource_reference).type": "spanner.googleapis.com/BackupSchedule"
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
},
|
|
2313
|
+
"ListBackupSchedulesRequest": {
|
|
2314
|
+
"fields": {
|
|
2315
|
+
"parent": {
|
|
2316
|
+
"type": "string",
|
|
2317
|
+
"id": 1,
|
|
2318
|
+
"options": {
|
|
2319
|
+
"(google.api.field_behavior)": "REQUIRED",
|
|
2320
|
+
"(google.api.resource_reference).type": "spanner.googleapis.com/Database"
|
|
2321
|
+
}
|
|
2322
|
+
},
|
|
2323
|
+
"pageSize": {
|
|
2324
|
+
"type": "int32",
|
|
2325
|
+
"id": 2,
|
|
2326
|
+
"options": {
|
|
2327
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
2328
|
+
}
|
|
2329
|
+
},
|
|
2330
|
+
"pageToken": {
|
|
2331
|
+
"type": "string",
|
|
2332
|
+
"id": 4,
|
|
2333
|
+
"options": {
|
|
2334
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
},
|
|
2339
|
+
"ListBackupSchedulesResponse": {
|
|
2340
|
+
"fields": {
|
|
2341
|
+
"backupSchedules": {
|
|
2342
|
+
"rule": "repeated",
|
|
2343
|
+
"type": "BackupSchedule",
|
|
2344
|
+
"id": 1
|
|
2345
|
+
},
|
|
2346
|
+
"nextPageToken": {
|
|
2347
|
+
"type": "string",
|
|
2348
|
+
"id": 2
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
},
|
|
2352
|
+
"UpdateBackupScheduleRequest": {
|
|
2353
|
+
"fields": {
|
|
2354
|
+
"backupSchedule": {
|
|
2355
|
+
"type": "BackupSchedule",
|
|
2356
|
+
"id": 1,
|
|
2357
|
+
"options": {
|
|
2358
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
2359
|
+
}
|
|
2360
|
+
},
|
|
2361
|
+
"updateMask": {
|
|
2362
|
+
"type": "google.protobuf.FieldMask",
|
|
2363
|
+
"id": 2,
|
|
2364
|
+
"options": {
|
|
2365
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
},
|
|
2156
2370
|
"DatabaseAdmin": {
|
|
2157
2371
|
"options": {
|
|
2158
2372
|
"(google.api.default_host)": "spanner.googleapis.com",
|
|
@@ -2321,7 +2535,7 @@
|
|
|
2321
2535
|
"options": {
|
|
2322
2536
|
"(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy",
|
|
2323
2537
|
"(google.api.http).body": "*",
|
|
2324
|
-
"(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/
|
|
2538
|
+
"(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy",
|
|
2325
2539
|
"(google.api.http).additional_bindings.body": "*",
|
|
2326
2540
|
"(google.api.method_signature)": "resource,policy"
|
|
2327
2541
|
},
|
|
@@ -2330,10 +2544,16 @@
|
|
|
2330
2544
|
"(google.api.http)": {
|
|
2331
2545
|
"post": "/v1/{resource=projects/*/instances/*/databases/*}:setIamPolicy",
|
|
2332
2546
|
"body": "*",
|
|
2333
|
-
"additional_bindings":
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2547
|
+
"additional_bindings": [
|
|
2548
|
+
{
|
|
2549
|
+
"post": "/v1/{resource=projects/*/instances/*/backups/*}:setIamPolicy",
|
|
2550
|
+
"body": "*"
|
|
2551
|
+
},
|
|
2552
|
+
{
|
|
2553
|
+
"post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:setIamPolicy",
|
|
2554
|
+
"body": "*"
|
|
2555
|
+
}
|
|
2556
|
+
]
|
|
2337
2557
|
}
|
|
2338
2558
|
},
|
|
2339
2559
|
{
|
|
@@ -2347,7 +2567,7 @@
|
|
|
2347
2567
|
"options": {
|
|
2348
2568
|
"(google.api.http).post": "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy",
|
|
2349
2569
|
"(google.api.http).body": "*",
|
|
2350
|
-
"(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/
|
|
2570
|
+
"(google.api.http).additional_bindings.post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy",
|
|
2351
2571
|
"(google.api.http).additional_bindings.body": "*",
|
|
2352
2572
|
"(google.api.method_signature)": "resource"
|
|
2353
2573
|
},
|
|
@@ -2356,10 +2576,16 @@
|
|
|
2356
2576
|
"(google.api.http)": {
|
|
2357
2577
|
"post": "/v1/{resource=projects/*/instances/*/databases/*}:getIamPolicy",
|
|
2358
2578
|
"body": "*",
|
|
2359
|
-
"additional_bindings":
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2579
|
+
"additional_bindings": [
|
|
2580
|
+
{
|
|
2581
|
+
"post": "/v1/{resource=projects/*/instances/*/backups/*}:getIamPolicy",
|
|
2582
|
+
"body": "*"
|
|
2583
|
+
},
|
|
2584
|
+
{
|
|
2585
|
+
"post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:getIamPolicy",
|
|
2586
|
+
"body": "*"
|
|
2587
|
+
}
|
|
2588
|
+
]
|
|
2363
2589
|
}
|
|
2364
2590
|
},
|
|
2365
2591
|
{
|
|
@@ -2387,6 +2613,10 @@
|
|
|
2387
2613
|
"post": "/v1/{resource=projects/*/instances/*/backups/*}:testIamPermissions",
|
|
2388
2614
|
"body": "*"
|
|
2389
2615
|
},
|
|
2616
|
+
{
|
|
2617
|
+
"post": "/v1/{resource=projects/*/instances/*/databases/*/backupSchedules/*}:testIamPermissions",
|
|
2618
|
+
"body": "*"
|
|
2619
|
+
},
|
|
2390
2620
|
{
|
|
2391
2621
|
"post": "/v1/{resource=projects/*/instances/*/databases/*/databaseRoles/*}:testIamPermissions",
|
|
2392
2622
|
"body": "*"
|
|
@@ -2610,6 +2840,100 @@
|
|
|
2610
2840
|
"(google.api.method_signature)": "parent"
|
|
2611
2841
|
}
|
|
2612
2842
|
]
|
|
2843
|
+
},
|
|
2844
|
+
"CreateBackupSchedule": {
|
|
2845
|
+
"requestType": "CreateBackupScheduleRequest",
|
|
2846
|
+
"responseType": "BackupSchedule",
|
|
2847
|
+
"options": {
|
|
2848
|
+
"(google.api.http).post": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules",
|
|
2849
|
+
"(google.api.http).body": "backup_schedule",
|
|
2850
|
+
"(google.api.method_signature)": "parent,backup_schedule,backup_schedule_id"
|
|
2851
|
+
},
|
|
2852
|
+
"parsedOptions": [
|
|
2853
|
+
{
|
|
2854
|
+
"(google.api.http)": {
|
|
2855
|
+
"post": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules",
|
|
2856
|
+
"body": "backup_schedule"
|
|
2857
|
+
}
|
|
2858
|
+
},
|
|
2859
|
+
{
|
|
2860
|
+
"(google.api.method_signature)": "parent,backup_schedule,backup_schedule_id"
|
|
2861
|
+
}
|
|
2862
|
+
]
|
|
2863
|
+
},
|
|
2864
|
+
"GetBackupSchedule": {
|
|
2865
|
+
"requestType": "GetBackupScheduleRequest",
|
|
2866
|
+
"responseType": "BackupSchedule",
|
|
2867
|
+
"options": {
|
|
2868
|
+
"(google.api.http).get": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}",
|
|
2869
|
+
"(google.api.method_signature)": "name"
|
|
2870
|
+
},
|
|
2871
|
+
"parsedOptions": [
|
|
2872
|
+
{
|
|
2873
|
+
"(google.api.http)": {
|
|
2874
|
+
"get": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}"
|
|
2875
|
+
}
|
|
2876
|
+
},
|
|
2877
|
+
{
|
|
2878
|
+
"(google.api.method_signature)": "name"
|
|
2879
|
+
}
|
|
2880
|
+
]
|
|
2881
|
+
},
|
|
2882
|
+
"UpdateBackupSchedule": {
|
|
2883
|
+
"requestType": "UpdateBackupScheduleRequest",
|
|
2884
|
+
"responseType": "BackupSchedule",
|
|
2885
|
+
"options": {
|
|
2886
|
+
"(google.api.http).patch": "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}",
|
|
2887
|
+
"(google.api.http).body": "backup_schedule",
|
|
2888
|
+
"(google.api.method_signature)": "backup_schedule,update_mask"
|
|
2889
|
+
},
|
|
2890
|
+
"parsedOptions": [
|
|
2891
|
+
{
|
|
2892
|
+
"(google.api.http)": {
|
|
2893
|
+
"patch": "/v1/{backup_schedule.name=projects/*/instances/*/databases/*/backupSchedules/*}",
|
|
2894
|
+
"body": "backup_schedule"
|
|
2895
|
+
}
|
|
2896
|
+
},
|
|
2897
|
+
{
|
|
2898
|
+
"(google.api.method_signature)": "backup_schedule,update_mask"
|
|
2899
|
+
}
|
|
2900
|
+
]
|
|
2901
|
+
},
|
|
2902
|
+
"DeleteBackupSchedule": {
|
|
2903
|
+
"requestType": "DeleteBackupScheduleRequest",
|
|
2904
|
+
"responseType": "google.protobuf.Empty",
|
|
2905
|
+
"options": {
|
|
2906
|
+
"(google.api.http).delete": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}",
|
|
2907
|
+
"(google.api.method_signature)": "name"
|
|
2908
|
+
},
|
|
2909
|
+
"parsedOptions": [
|
|
2910
|
+
{
|
|
2911
|
+
"(google.api.http)": {
|
|
2912
|
+
"delete": "/v1/{name=projects/*/instances/*/databases/*/backupSchedules/*}"
|
|
2913
|
+
}
|
|
2914
|
+
},
|
|
2915
|
+
{
|
|
2916
|
+
"(google.api.method_signature)": "name"
|
|
2917
|
+
}
|
|
2918
|
+
]
|
|
2919
|
+
},
|
|
2920
|
+
"ListBackupSchedules": {
|
|
2921
|
+
"requestType": "ListBackupSchedulesRequest",
|
|
2922
|
+
"responseType": "ListBackupSchedulesResponse",
|
|
2923
|
+
"options": {
|
|
2924
|
+
"(google.api.http).get": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules",
|
|
2925
|
+
"(google.api.method_signature)": "parent"
|
|
2926
|
+
},
|
|
2927
|
+
"parsedOptions": [
|
|
2928
|
+
{
|
|
2929
|
+
"(google.api.http)": {
|
|
2930
|
+
"get": "/v1/{parent=projects/*/instances/*/databases/*}/backupSchedules"
|
|
2931
|
+
}
|
|
2932
|
+
},
|
|
2933
|
+
{
|
|
2934
|
+
"(google.api.method_signature)": "parent"
|
|
2935
|
+
}
|
|
2936
|
+
]
|
|
2613
2937
|
}
|
|
2614
2938
|
}
|
|
2615
2939
|
},
|
|
@@ -4694,7 +5018,8 @@
|
|
|
4694
5018
|
"generateDbPartitionsRead",
|
|
4695
5019
|
"generateDbPartitionsQuery",
|
|
4696
5020
|
"executePartition",
|
|
4697
|
-
"executeChangeStreamQuery"
|
|
5021
|
+
"executeChangeStreamQuery",
|
|
5022
|
+
"queryCancellation"
|
|
4698
5023
|
]
|
|
4699
5024
|
}
|
|
4700
5025
|
},
|
|
@@ -4770,6 +5095,10 @@
|
|
|
4770
5095
|
"executeChangeStreamQuery": {
|
|
4771
5096
|
"type": "ExecuteChangeStreamQuery",
|
|
4772
5097
|
"id": 50
|
|
5098
|
+
},
|
|
5099
|
+
"queryCancellation": {
|
|
5100
|
+
"type": "QueryCancellationAction",
|
|
5101
|
+
"id": 51
|
|
4773
5102
|
}
|
|
4774
5103
|
}
|
|
4775
5104
|
},
|
|
@@ -6172,6 +6501,18 @@
|
|
|
6172
6501
|
}
|
|
6173
6502
|
}
|
|
6174
6503
|
},
|
|
6504
|
+
"QueryCancellationAction": {
|
|
6505
|
+
"fields": {
|
|
6506
|
+
"longRunningSql": {
|
|
6507
|
+
"type": "string",
|
|
6508
|
+
"id": 1
|
|
6509
|
+
},
|
|
6510
|
+
"cancelQuery": {
|
|
6511
|
+
"type": "string",
|
|
6512
|
+
"id": 2
|
|
6513
|
+
}
|
|
6514
|
+
}
|
|
6515
|
+
},
|
|
6175
6516
|
"CancelOperationAction": {
|
|
6176
6517
|
"fields": {
|
|
6177
6518
|
"operation": {
|
|
@@ -7772,6 +8113,36 @@
|
|
|
7772
8113
|
"dataBoostEnabled": {
|
|
7773
8114
|
"type": "bool",
|
|
7774
8115
|
"id": 15
|
|
8116
|
+
},
|
|
8117
|
+
"orderBy": {
|
|
8118
|
+
"type": "OrderBy",
|
|
8119
|
+
"id": 16,
|
|
8120
|
+
"options": {
|
|
8121
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
8122
|
+
}
|
|
8123
|
+
},
|
|
8124
|
+
"lockHint": {
|
|
8125
|
+
"type": "LockHint",
|
|
8126
|
+
"id": 17,
|
|
8127
|
+
"options": {
|
|
8128
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
8129
|
+
}
|
|
8130
|
+
}
|
|
8131
|
+
},
|
|
8132
|
+
"nested": {
|
|
8133
|
+
"OrderBy": {
|
|
8134
|
+
"values": {
|
|
8135
|
+
"ORDER_BY_UNSPECIFIED": 0,
|
|
8136
|
+
"ORDER_BY_PRIMARY_KEY": 1,
|
|
8137
|
+
"ORDER_BY_NO_ORDER": 2
|
|
8138
|
+
}
|
|
8139
|
+
},
|
|
8140
|
+
"LockHint": {
|
|
8141
|
+
"values": {
|
|
8142
|
+
"LOCK_HINT_UNSPECIFIED": 0,
|
|
8143
|
+
"LOCK_HINT_SHARED": 1,
|
|
8144
|
+
"LOCK_HINT_EXCLUSIVE": 2
|
|
8145
|
+
}
|
|
7775
8146
|
}
|
|
7776
8147
|
}
|
|
7777
8148
|
},
|
package/build/src/database.js
CHANGED
|
@@ -442,15 +442,30 @@ class Database extends common.GrpcServiceObject {
|
|
|
442
442
|
const [metadata] = await this.getMetadata(gaxOptions);
|
|
443
443
|
return metadata.state || undefined;
|
|
444
444
|
}
|
|
445
|
-
async getDatabaseDialect(optionsOrCallback,
|
|
446
|
-
const gaxOptions = typeof optionsOrCallback === 'object'
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
445
|
+
async getDatabaseDialect(optionsOrCallback, callback) {
|
|
446
|
+
const gaxOptions = typeof optionsOrCallback === 'object'
|
|
447
|
+
? optionsOrCallback
|
|
448
|
+
: {};
|
|
449
|
+
const cb = typeof optionsOrCallback === 'function'
|
|
450
|
+
? optionsOrCallback
|
|
451
|
+
: callback;
|
|
452
|
+
try {
|
|
453
|
+
if (this.databaseDialect === 'DATABASE_DIALECT_UNSPECIFIED' ||
|
|
454
|
+
this.databaseDialect === null ||
|
|
455
|
+
this.databaseDialect === undefined) {
|
|
456
|
+
const [metadata] = await this.getMetadata(gaxOptions);
|
|
457
|
+
this.databaseDialect = metadata.databaseDialect;
|
|
458
|
+
}
|
|
459
|
+
if (cb) {
|
|
460
|
+
cb(null, this.databaseDialect);
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
return this.databaseDialect || undefined;
|
|
464
|
+
}
|
|
465
|
+
catch (err) {
|
|
466
|
+
cb(err);
|
|
467
|
+
return;
|
|
452
468
|
}
|
|
453
|
-
return this.databaseDialect || undefined;
|
|
454
469
|
}
|
|
455
470
|
getSchema(optionsOrCallback, cb) {
|
|
456
471
|
const gaxOpts = typeof optionsOrCallback === 'object' ? optionsOrCallback : {};
|
|
@@ -1220,6 +1235,7 @@ class Database extends common.GrpcServiceObject {
|
|
|
1220
1235
|
session: session.formattedName_,
|
|
1221
1236
|
mutationGroups: mutationGroups.map(mg => mg.proto()),
|
|
1222
1237
|
requestOptions: options === null || options === void 0 ? void 0 : options.requestOptions,
|
|
1238
|
+
excludeTxnFromChangeStream: options === null || options === void 0 ? void 0 : options.excludeTxnFromChangeStreams,
|
|
1223
1239
|
});
|
|
1224
1240
|
let dataReceived = false;
|
|
1225
1241
|
let dataStream = this.requestStream({
|
|
@@ -1394,6 +1410,7 @@ exports.Database = Database;
|
|
|
1394
1410
|
'delete',
|
|
1395
1411
|
'exists',
|
|
1396
1412
|
'get',
|
|
1413
|
+
'getDatabaseDialect',
|
|
1397
1414
|
'getMetadata',
|
|
1398
1415
|
'getSchema',
|
|
1399
1416
|
'getSessions',
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Readable, Transform } from 'stream';
|
|
17
|
+
import { CallOptions } from 'google-gax';
|
|
17
18
|
import { JSONOptions, Json, Field, Value } from './codec';
|
|
18
19
|
import { google } from '../protos/protos';
|
|
19
20
|
export type ResumeToken = string | Uint8Array;
|
|
@@ -81,6 +82,7 @@ export interface RowOptions {
|
|
|
81
82
|
* };
|
|
82
83
|
*/
|
|
83
84
|
columnsMetadata?: object;
|
|
85
|
+
gaxOptions?: CallOptions;
|
|
84
86
|
}
|
|
85
87
|
/**
|
|
86
88
|
* By default rows are an Array of values in the form of objects containing
|
|
@@ -284,10 +284,13 @@ exports.PartialResultStream = PartialResultStream;
|
|
|
284
284
|
* @returns {PartialResultStream}
|
|
285
285
|
*/
|
|
286
286
|
function partialResultStream(requestFn, options) {
|
|
287
|
+
var _a, _b;
|
|
287
288
|
const retryableCodes = [google_gax_1.grpc.status.UNAVAILABLE];
|
|
288
289
|
const maxQueued = 10;
|
|
289
290
|
let lastResumeToken;
|
|
290
291
|
let lastRequestStream;
|
|
292
|
+
const startTime = Date.now();
|
|
293
|
+
const timeout = (_b = (_a = options === null || options === void 0 ? void 0 : options.gaxOptions) === null || _a === void 0 ? void 0 : _a.timeout) !== null && _b !== void 0 ? _b : Infinity;
|
|
291
294
|
// mergeStream allows multiple streams to be connected into one. This is good;
|
|
292
295
|
// if we need to retry a request and pipe more data to the user's stream.
|
|
293
296
|
// We also add an additional stream that can be used to flush any remaining
|
|
@@ -336,6 +339,14 @@ function partialResultStream(requestFn, options) {
|
|
|
336
339
|
requestsStream.add(lastRequestStream);
|
|
337
340
|
};
|
|
338
341
|
const retry = (err) => {
|
|
342
|
+
const elapsed = Date.now() - startTime;
|
|
343
|
+
if (elapsed >= timeout) {
|
|
344
|
+
// The timeout has reached so this will flush any rows the
|
|
345
|
+
// checkpoint stream has queued. After that, we will destroy the
|
|
346
|
+
// user's stream with the Deadline exceeded error.
|
|
347
|
+
setImmediate(() => batchAndSplitOnTokenStream.destroy(new transaction_runner_1.DeadlineError(err)));
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
339
350
|
if (!(err.code &&
|
|
340
351
|
(retryableCodes.includes(err.code) || (0, transaction_runner_1.isRetryableInternalError)(err))) ||
|
|
341
352
|
// If we have received too many chunks without a resume token, it is not
|
|
@@ -41,6 +41,7 @@ export interface TimestampBounds {
|
|
|
41
41
|
export interface BatchWriteOptions {
|
|
42
42
|
requestOptions?: Pick<IRequestOptions, 'priority' | 'transactionTag'>;
|
|
43
43
|
gaxOptions?: CallOptions;
|
|
44
|
+
excludeTxnFromChangeStreams?: boolean;
|
|
44
45
|
}
|
|
45
46
|
export interface RequestOptions {
|
|
46
47
|
json?: boolean;
|
package/build/src/transaction.js
CHANGED
|
@@ -410,6 +410,7 @@ class Snapshot extends events_1.EventEmitter {
|
|
|
410
410
|
jsonOptions,
|
|
411
411
|
maxResumeRetries,
|
|
412
412
|
columnsMetadata,
|
|
413
|
+
gaxOptions,
|
|
413
414
|
})) === null || _c === void 0 ? void 0 : _c.on('response', response => {
|
|
414
415
|
if (response.metadata && response.metadata.transaction && !this.id) {
|
|
415
416
|
this._update(response.metadata.transaction);
|
|
@@ -677,6 +678,7 @@ class Snapshot extends events_1.EventEmitter {
|
|
|
677
678
|
jsonOptions,
|
|
678
679
|
maxResumeRetries,
|
|
679
680
|
columnsMetadata,
|
|
681
|
+
gaxOptions,
|
|
680
682
|
})
|
|
681
683
|
.on('response', response => {
|
|
682
684
|
if (response.metadata && response.metadata.transaction && !this.id) {
|