@google-cloud/spanner 7.15.0 → 7.17.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/README.md +2 -0
- package/build/protos/google/spanner/admin/instance/v1/common.proto +7 -0
- package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +139 -16
- package/build/protos/google/spanner/v1/commit_response.proto +9 -0
- package/build/protos/google/spanner/v1/result_set.proto +21 -0
- package/build/protos/google/spanner/v1/spanner.proto +61 -2
- package/build/protos/google/spanner/v1/transaction.proto +34 -0
- package/build/protos/google/spanner/v1/type.proto +43 -30
- package/build/protos/protos.d.ts +1724 -1112
- package/build/protos/protos.js +5185 -3528
- package/build/protos/protos.json +321 -129
- package/build/src/common.d.ts +8 -0
- package/build/src/common.js +19 -1
- package/build/src/database.d.ts +8 -1
- package/build/src/database.js +63 -56
- package/build/src/helper.d.ts +45 -0
- package/build/src/helper.js +71 -0
- package/build/src/index.d.ts +1 -1
- package/build/src/index.js +18 -11
- package/build/src/instance-config.d.ts +1 -0
- package/build/src/instance.d.ts +2 -1
- package/build/src/instance.js +12 -13
- package/build/src/instrument.d.ts +3 -0
- package/build/src/instrument.js +5 -1
- package/build/src/multiplexed-session.d.ts +136 -0
- package/build/src/multiplexed-session.js +197 -0
- package/build/src/session-factory.d.ts +101 -0
- package/build/src/session-factory.js +93 -0
- package/build/src/session-pool.d.ts +1 -39
- package/build/src/session-pool.js +6 -58
- package/build/src/session.d.ts +2 -1
- package/build/src/session.js +5 -6
- package/build/src/transaction.d.ts +1 -1
- package/build/src/transaction.js +8 -9
- package/build/src/v1/spanner_client.d.ts +44 -0
- package/build/src/v1/spanner_client.js +10 -0
- package/package.json +3 -2
package/build/protos/protos.json
CHANGED
|
@@ -3619,6 +3619,17 @@
|
|
|
3619
3619
|
"FULFILLMENT_PERIOD_EXTENDED": 2
|
|
3620
3620
|
}
|
|
3621
3621
|
},
|
|
3622
|
+
"ReplicaSelection": {
|
|
3623
|
+
"fields": {
|
|
3624
|
+
"location": {
|
|
3625
|
+
"type": "string",
|
|
3626
|
+
"id": 1,
|
|
3627
|
+
"options": {
|
|
3628
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
}
|
|
3632
|
+
},
|
|
3622
3633
|
"InstanceAdmin": {
|
|
3623
3634
|
"options": {
|
|
3624
3635
|
"(google.api.default_host)": "spanner.googleapis.com",
|
|
@@ -4190,6 +4201,33 @@
|
|
|
4190
4201
|
}
|
|
4191
4202
|
}
|
|
4192
4203
|
},
|
|
4204
|
+
"ReplicaComputeCapacity": {
|
|
4205
|
+
"oneofs": {
|
|
4206
|
+
"computeCapacity": {
|
|
4207
|
+
"oneof": [
|
|
4208
|
+
"nodeCount",
|
|
4209
|
+
"processingUnits"
|
|
4210
|
+
]
|
|
4211
|
+
}
|
|
4212
|
+
},
|
|
4213
|
+
"fields": {
|
|
4214
|
+
"replicaSelection": {
|
|
4215
|
+
"type": "ReplicaSelection",
|
|
4216
|
+
"id": 1,
|
|
4217
|
+
"options": {
|
|
4218
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
4219
|
+
}
|
|
4220
|
+
},
|
|
4221
|
+
"nodeCount": {
|
|
4222
|
+
"type": "int32",
|
|
4223
|
+
"id": 2
|
|
4224
|
+
},
|
|
4225
|
+
"processingUnits": {
|
|
4226
|
+
"type": "int32",
|
|
4227
|
+
"id": 3
|
|
4228
|
+
}
|
|
4229
|
+
}
|
|
4230
|
+
},
|
|
4193
4231
|
"AutoscalingConfig": {
|
|
4194
4232
|
"fields": {
|
|
4195
4233
|
"autoscalingLimits": {
|
|
@@ -4205,6 +4243,14 @@
|
|
|
4205
4243
|
"options": {
|
|
4206
4244
|
"(google.api.field_behavior)": "REQUIRED"
|
|
4207
4245
|
}
|
|
4246
|
+
},
|
|
4247
|
+
"asymmetricAutoscalingOptions": {
|
|
4248
|
+
"rule": "repeated",
|
|
4249
|
+
"type": "AsymmetricAutoscalingOption",
|
|
4250
|
+
"id": 3,
|
|
4251
|
+
"options": {
|
|
4252
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
4253
|
+
}
|
|
4208
4254
|
}
|
|
4209
4255
|
},
|
|
4210
4256
|
"nested": {
|
|
@@ -4259,6 +4305,44 @@
|
|
|
4259
4305
|
}
|
|
4260
4306
|
}
|
|
4261
4307
|
}
|
|
4308
|
+
},
|
|
4309
|
+
"AsymmetricAutoscalingOption": {
|
|
4310
|
+
"fields": {
|
|
4311
|
+
"replicaSelection": {
|
|
4312
|
+
"type": "ReplicaSelection",
|
|
4313
|
+
"id": 1,
|
|
4314
|
+
"options": {
|
|
4315
|
+
"(google.api.field_behavior)": "REQUIRED"
|
|
4316
|
+
}
|
|
4317
|
+
},
|
|
4318
|
+
"overrides": {
|
|
4319
|
+
"type": "AutoscalingConfigOverrides",
|
|
4320
|
+
"id": 2,
|
|
4321
|
+
"options": {
|
|
4322
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
4323
|
+
}
|
|
4324
|
+
}
|
|
4325
|
+
},
|
|
4326
|
+
"nested": {
|
|
4327
|
+
"AutoscalingConfigOverrides": {
|
|
4328
|
+
"fields": {
|
|
4329
|
+
"autoscalingLimits": {
|
|
4330
|
+
"type": "AutoscalingLimits",
|
|
4331
|
+
"id": 1,
|
|
4332
|
+
"options": {
|
|
4333
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
4334
|
+
}
|
|
4335
|
+
},
|
|
4336
|
+
"autoscalingTargetHighPriorityCpuUtilizationPercent": {
|
|
4337
|
+
"type": "int32",
|
|
4338
|
+
"id": 2,
|
|
4339
|
+
"options": {
|
|
4340
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
4341
|
+
}
|
|
4342
|
+
}
|
|
4343
|
+
}
|
|
4344
|
+
}
|
|
4345
|
+
}
|
|
4262
4346
|
}
|
|
4263
4347
|
}
|
|
4264
4348
|
},
|
|
@@ -4298,6 +4382,14 @@
|
|
|
4298
4382
|
"type": "int32",
|
|
4299
4383
|
"id": 9
|
|
4300
4384
|
},
|
|
4385
|
+
"replicaComputeCapacity": {
|
|
4386
|
+
"rule": "repeated",
|
|
4387
|
+
"type": "ReplicaComputeCapacity",
|
|
4388
|
+
"id": 19,
|
|
4389
|
+
"options": {
|
|
4390
|
+
"(google.api.field_behavior)": "OUTPUT_ONLY"
|
|
4391
|
+
}
|
|
4392
|
+
},
|
|
4301
4393
|
"autoscalingConfig": {
|
|
4302
4394
|
"type": "AutoscalingConfig",
|
|
4303
4395
|
"id": 17,
|
|
@@ -4342,6 +4434,13 @@
|
|
|
4342
4434
|
"options": {
|
|
4343
4435
|
"(google.api.field_behavior)": "OPTIONAL"
|
|
4344
4436
|
}
|
|
4437
|
+
},
|
|
4438
|
+
"defaultBackupScheduleType": {
|
|
4439
|
+
"type": "DefaultBackupScheduleType",
|
|
4440
|
+
"id": 23,
|
|
4441
|
+
"options": {
|
|
4442
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
4443
|
+
}
|
|
4345
4444
|
}
|
|
4346
4445
|
},
|
|
4347
4446
|
"nested": {
|
|
@@ -4359,6 +4458,13 @@
|
|
|
4359
4458
|
"ENTERPRISE": 2,
|
|
4360
4459
|
"ENTERPRISE_PLUS": 3
|
|
4361
4460
|
}
|
|
4461
|
+
},
|
|
4462
|
+
"DefaultBackupScheduleType": {
|
|
4463
|
+
"values": {
|
|
4464
|
+
"DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIED": 0,
|
|
4465
|
+
"NONE": 1,
|
|
4466
|
+
"AUTOMATIC": 2
|
|
4467
|
+
}
|
|
4362
4468
|
}
|
|
4363
4469
|
}
|
|
4364
4470
|
},
|
|
@@ -7959,6 +8065,13 @@
|
|
|
7959
8065
|
"dataBoostEnabled": {
|
|
7960
8066
|
"type": "bool",
|
|
7961
8067
|
"id": 16
|
|
8068
|
+
},
|
|
8069
|
+
"lastStatement": {
|
|
8070
|
+
"type": "bool",
|
|
8071
|
+
"id": 17,
|
|
8072
|
+
"options": {
|
|
8073
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
8074
|
+
}
|
|
7962
8075
|
}
|
|
7963
8076
|
},
|
|
7964
8077
|
"nested": {
|
|
@@ -7966,7 +8079,9 @@
|
|
|
7966
8079
|
"values": {
|
|
7967
8080
|
"NORMAL": 0,
|
|
7968
8081
|
"PLAN": 1,
|
|
7969
|
-
"PROFILE": 2
|
|
8082
|
+
"PROFILE": 2,
|
|
8083
|
+
"WITH_STATS": 3,
|
|
8084
|
+
"WITH_PLAN_AND_STATS": 4
|
|
7970
8085
|
}
|
|
7971
8086
|
},
|
|
7972
8087
|
"QueryOptions": {
|
|
@@ -8018,6 +8133,13 @@
|
|
|
8018
8133
|
"requestOptions": {
|
|
8019
8134
|
"type": "RequestOptions",
|
|
8020
8135
|
"id": 5
|
|
8136
|
+
},
|
|
8137
|
+
"lastStatements": {
|
|
8138
|
+
"type": "bool",
|
|
8139
|
+
"id": 6,
|
|
8140
|
+
"options": {
|
|
8141
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
8142
|
+
}
|
|
8021
8143
|
}
|
|
8022
8144
|
},
|
|
8023
8145
|
"nested": {
|
|
@@ -8053,6 +8175,13 @@
|
|
|
8053
8175
|
"status": {
|
|
8054
8176
|
"type": "google.rpc.Status",
|
|
8055
8177
|
"id": 2
|
|
8178
|
+
},
|
|
8179
|
+
"precommitToken": {
|
|
8180
|
+
"type": "MultiplexedSessionPrecommitToken",
|
|
8181
|
+
"id": 3,
|
|
8182
|
+
"options": {
|
|
8183
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
8184
|
+
}
|
|
8056
8185
|
}
|
|
8057
8186
|
}
|
|
8058
8187
|
},
|
|
@@ -8284,6 +8413,13 @@
|
|
|
8284
8413
|
"requestOptions": {
|
|
8285
8414
|
"type": "RequestOptions",
|
|
8286
8415
|
"id": 3
|
|
8416
|
+
},
|
|
8417
|
+
"mutationKey": {
|
|
8418
|
+
"type": "Mutation",
|
|
8419
|
+
"id": 4,
|
|
8420
|
+
"options": {
|
|
8421
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
8422
|
+
}
|
|
8287
8423
|
}
|
|
8288
8424
|
}
|
|
8289
8425
|
},
|
|
@@ -8332,6 +8468,13 @@
|
|
|
8332
8468
|
"requestOptions": {
|
|
8333
8469
|
"type": "RequestOptions",
|
|
8334
8470
|
"id": 6
|
|
8471
|
+
},
|
|
8472
|
+
"precommitToken": {
|
|
8473
|
+
"type": "MultiplexedSessionPrecommitToken",
|
|
8474
|
+
"id": 9,
|
|
8475
|
+
"options": {
|
|
8476
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
8477
|
+
}
|
|
8335
8478
|
}
|
|
8336
8479
|
}
|
|
8337
8480
|
},
|
|
@@ -8417,6 +8560,13 @@
|
|
|
8417
8560
|
}
|
|
8418
8561
|
},
|
|
8419
8562
|
"CommitResponse": {
|
|
8563
|
+
"oneofs": {
|
|
8564
|
+
"MultiplexedSessionRetry": {
|
|
8565
|
+
"oneof": [
|
|
8566
|
+
"precommitToken"
|
|
8567
|
+
]
|
|
8568
|
+
}
|
|
8569
|
+
},
|
|
8420
8570
|
"fields": {
|
|
8421
8571
|
"commitTimestamp": {
|
|
8422
8572
|
"type": "google.protobuf.Timestamp",
|
|
@@ -8425,6 +8575,10 @@
|
|
|
8425
8575
|
"commitStats": {
|
|
8426
8576
|
"type": "CommitStats",
|
|
8427
8577
|
"id": 2
|
|
8578
|
+
},
|
|
8579
|
+
"precommitToken": {
|
|
8580
|
+
"type": "MultiplexedSessionPrecommitToken",
|
|
8581
|
+
"id": 4
|
|
8428
8582
|
}
|
|
8429
8583
|
},
|
|
8430
8584
|
"nested": {
|
|
@@ -8438,6 +8592,156 @@
|
|
|
8438
8592
|
}
|
|
8439
8593
|
}
|
|
8440
8594
|
},
|
|
8595
|
+
"TransactionOptions": {
|
|
8596
|
+
"oneofs": {
|
|
8597
|
+
"mode": {
|
|
8598
|
+
"oneof": [
|
|
8599
|
+
"readWrite",
|
|
8600
|
+
"partitionedDml",
|
|
8601
|
+
"readOnly"
|
|
8602
|
+
]
|
|
8603
|
+
}
|
|
8604
|
+
},
|
|
8605
|
+
"fields": {
|
|
8606
|
+
"readWrite": {
|
|
8607
|
+
"type": "ReadWrite",
|
|
8608
|
+
"id": 1
|
|
8609
|
+
},
|
|
8610
|
+
"partitionedDml": {
|
|
8611
|
+
"type": "PartitionedDml",
|
|
8612
|
+
"id": 3
|
|
8613
|
+
},
|
|
8614
|
+
"readOnly": {
|
|
8615
|
+
"type": "ReadOnly",
|
|
8616
|
+
"id": 2
|
|
8617
|
+
},
|
|
8618
|
+
"excludeTxnFromChangeStreams": {
|
|
8619
|
+
"type": "bool",
|
|
8620
|
+
"id": 5
|
|
8621
|
+
}
|
|
8622
|
+
},
|
|
8623
|
+
"nested": {
|
|
8624
|
+
"ReadWrite": {
|
|
8625
|
+
"fields": {
|
|
8626
|
+
"readLockMode": {
|
|
8627
|
+
"type": "ReadLockMode",
|
|
8628
|
+
"id": 1
|
|
8629
|
+
},
|
|
8630
|
+
"multiplexedSessionPreviousTransactionId": {
|
|
8631
|
+
"type": "bytes",
|
|
8632
|
+
"id": 2,
|
|
8633
|
+
"options": {
|
|
8634
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
8635
|
+
}
|
|
8636
|
+
}
|
|
8637
|
+
},
|
|
8638
|
+
"nested": {
|
|
8639
|
+
"ReadLockMode": {
|
|
8640
|
+
"values": {
|
|
8641
|
+
"READ_LOCK_MODE_UNSPECIFIED": 0,
|
|
8642
|
+
"PESSIMISTIC": 1,
|
|
8643
|
+
"OPTIMISTIC": 2
|
|
8644
|
+
}
|
|
8645
|
+
}
|
|
8646
|
+
}
|
|
8647
|
+
},
|
|
8648
|
+
"PartitionedDml": {
|
|
8649
|
+
"fields": {}
|
|
8650
|
+
},
|
|
8651
|
+
"ReadOnly": {
|
|
8652
|
+
"oneofs": {
|
|
8653
|
+
"timestampBound": {
|
|
8654
|
+
"oneof": [
|
|
8655
|
+
"strong",
|
|
8656
|
+
"minReadTimestamp",
|
|
8657
|
+
"maxStaleness",
|
|
8658
|
+
"readTimestamp",
|
|
8659
|
+
"exactStaleness"
|
|
8660
|
+
]
|
|
8661
|
+
}
|
|
8662
|
+
},
|
|
8663
|
+
"fields": {
|
|
8664
|
+
"strong": {
|
|
8665
|
+
"type": "bool",
|
|
8666
|
+
"id": 1
|
|
8667
|
+
},
|
|
8668
|
+
"minReadTimestamp": {
|
|
8669
|
+
"type": "google.protobuf.Timestamp",
|
|
8670
|
+
"id": 2
|
|
8671
|
+
},
|
|
8672
|
+
"maxStaleness": {
|
|
8673
|
+
"type": "google.protobuf.Duration",
|
|
8674
|
+
"id": 3
|
|
8675
|
+
},
|
|
8676
|
+
"readTimestamp": {
|
|
8677
|
+
"type": "google.protobuf.Timestamp",
|
|
8678
|
+
"id": 4
|
|
8679
|
+
},
|
|
8680
|
+
"exactStaleness": {
|
|
8681
|
+
"type": "google.protobuf.Duration",
|
|
8682
|
+
"id": 5
|
|
8683
|
+
},
|
|
8684
|
+
"returnReadTimestamp": {
|
|
8685
|
+
"type": "bool",
|
|
8686
|
+
"id": 6
|
|
8687
|
+
}
|
|
8688
|
+
}
|
|
8689
|
+
}
|
|
8690
|
+
}
|
|
8691
|
+
},
|
|
8692
|
+
"Transaction": {
|
|
8693
|
+
"fields": {
|
|
8694
|
+
"id": {
|
|
8695
|
+
"type": "bytes",
|
|
8696
|
+
"id": 1
|
|
8697
|
+
},
|
|
8698
|
+
"readTimestamp": {
|
|
8699
|
+
"type": "google.protobuf.Timestamp",
|
|
8700
|
+
"id": 2
|
|
8701
|
+
},
|
|
8702
|
+
"precommitToken": {
|
|
8703
|
+
"type": "MultiplexedSessionPrecommitToken",
|
|
8704
|
+
"id": 3
|
|
8705
|
+
}
|
|
8706
|
+
}
|
|
8707
|
+
},
|
|
8708
|
+
"TransactionSelector": {
|
|
8709
|
+
"oneofs": {
|
|
8710
|
+
"selector": {
|
|
8711
|
+
"oneof": [
|
|
8712
|
+
"singleUse",
|
|
8713
|
+
"id",
|
|
8714
|
+
"begin"
|
|
8715
|
+
]
|
|
8716
|
+
}
|
|
8717
|
+
},
|
|
8718
|
+
"fields": {
|
|
8719
|
+
"singleUse": {
|
|
8720
|
+
"type": "TransactionOptions",
|
|
8721
|
+
"id": 1
|
|
8722
|
+
},
|
|
8723
|
+
"id": {
|
|
8724
|
+
"type": "bytes",
|
|
8725
|
+
"id": 2
|
|
8726
|
+
},
|
|
8727
|
+
"begin": {
|
|
8728
|
+
"type": "TransactionOptions",
|
|
8729
|
+
"id": 3
|
|
8730
|
+
}
|
|
8731
|
+
}
|
|
8732
|
+
},
|
|
8733
|
+
"MultiplexedSessionPrecommitToken": {
|
|
8734
|
+
"fields": {
|
|
8735
|
+
"precommitToken": {
|
|
8736
|
+
"type": "bytes",
|
|
8737
|
+
"id": 1
|
|
8738
|
+
},
|
|
8739
|
+
"seqNum": {
|
|
8740
|
+
"type": "int32",
|
|
8741
|
+
"id": 2
|
|
8742
|
+
}
|
|
8743
|
+
}
|
|
8744
|
+
},
|
|
8441
8745
|
"KeyRange": {
|
|
8442
8746
|
"oneofs": {
|
|
8443
8747
|
"startKeyType": {
|
|
@@ -8580,6 +8884,13 @@
|
|
|
8580
8884
|
"stats": {
|
|
8581
8885
|
"type": "ResultSetStats",
|
|
8582
8886
|
"id": 3
|
|
8887
|
+
},
|
|
8888
|
+
"precommitToken": {
|
|
8889
|
+
"type": "MultiplexedSessionPrecommitToken",
|
|
8890
|
+
"id": 5,
|
|
8891
|
+
"options": {
|
|
8892
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
8893
|
+
}
|
|
8583
8894
|
}
|
|
8584
8895
|
}
|
|
8585
8896
|
},
|
|
@@ -8605,6 +8916,13 @@
|
|
|
8605
8916
|
"stats": {
|
|
8606
8917
|
"type": "ResultSetStats",
|
|
8607
8918
|
"id": 5
|
|
8919
|
+
},
|
|
8920
|
+
"precommitToken": {
|
|
8921
|
+
"type": "MultiplexedSessionPrecommitToken",
|
|
8922
|
+
"id": 8,
|
|
8923
|
+
"options": {
|
|
8924
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
8925
|
+
}
|
|
8608
8926
|
}
|
|
8609
8927
|
}
|
|
8610
8928
|
},
|
|
@@ -8732,133 +9050,6 @@
|
|
|
8732
9050
|
}
|
|
8733
9051
|
}
|
|
8734
9052
|
},
|
|
8735
|
-
"TransactionOptions": {
|
|
8736
|
-
"oneofs": {
|
|
8737
|
-
"mode": {
|
|
8738
|
-
"oneof": [
|
|
8739
|
-
"readWrite",
|
|
8740
|
-
"partitionedDml",
|
|
8741
|
-
"readOnly"
|
|
8742
|
-
]
|
|
8743
|
-
}
|
|
8744
|
-
},
|
|
8745
|
-
"fields": {
|
|
8746
|
-
"readWrite": {
|
|
8747
|
-
"type": "ReadWrite",
|
|
8748
|
-
"id": 1
|
|
8749
|
-
},
|
|
8750
|
-
"partitionedDml": {
|
|
8751
|
-
"type": "PartitionedDml",
|
|
8752
|
-
"id": 3
|
|
8753
|
-
},
|
|
8754
|
-
"readOnly": {
|
|
8755
|
-
"type": "ReadOnly",
|
|
8756
|
-
"id": 2
|
|
8757
|
-
},
|
|
8758
|
-
"excludeTxnFromChangeStreams": {
|
|
8759
|
-
"type": "bool",
|
|
8760
|
-
"id": 5
|
|
8761
|
-
}
|
|
8762
|
-
},
|
|
8763
|
-
"nested": {
|
|
8764
|
-
"ReadWrite": {
|
|
8765
|
-
"fields": {
|
|
8766
|
-
"readLockMode": {
|
|
8767
|
-
"type": "ReadLockMode",
|
|
8768
|
-
"id": 1
|
|
8769
|
-
}
|
|
8770
|
-
},
|
|
8771
|
-
"nested": {
|
|
8772
|
-
"ReadLockMode": {
|
|
8773
|
-
"values": {
|
|
8774
|
-
"READ_LOCK_MODE_UNSPECIFIED": 0,
|
|
8775
|
-
"PESSIMISTIC": 1,
|
|
8776
|
-
"OPTIMISTIC": 2
|
|
8777
|
-
}
|
|
8778
|
-
}
|
|
8779
|
-
}
|
|
8780
|
-
},
|
|
8781
|
-
"PartitionedDml": {
|
|
8782
|
-
"fields": {}
|
|
8783
|
-
},
|
|
8784
|
-
"ReadOnly": {
|
|
8785
|
-
"oneofs": {
|
|
8786
|
-
"timestampBound": {
|
|
8787
|
-
"oneof": [
|
|
8788
|
-
"strong",
|
|
8789
|
-
"minReadTimestamp",
|
|
8790
|
-
"maxStaleness",
|
|
8791
|
-
"readTimestamp",
|
|
8792
|
-
"exactStaleness"
|
|
8793
|
-
]
|
|
8794
|
-
}
|
|
8795
|
-
},
|
|
8796
|
-
"fields": {
|
|
8797
|
-
"strong": {
|
|
8798
|
-
"type": "bool",
|
|
8799
|
-
"id": 1
|
|
8800
|
-
},
|
|
8801
|
-
"minReadTimestamp": {
|
|
8802
|
-
"type": "google.protobuf.Timestamp",
|
|
8803
|
-
"id": 2
|
|
8804
|
-
},
|
|
8805
|
-
"maxStaleness": {
|
|
8806
|
-
"type": "google.protobuf.Duration",
|
|
8807
|
-
"id": 3
|
|
8808
|
-
},
|
|
8809
|
-
"readTimestamp": {
|
|
8810
|
-
"type": "google.protobuf.Timestamp",
|
|
8811
|
-
"id": 4
|
|
8812
|
-
},
|
|
8813
|
-
"exactStaleness": {
|
|
8814
|
-
"type": "google.protobuf.Duration",
|
|
8815
|
-
"id": 5
|
|
8816
|
-
},
|
|
8817
|
-
"returnReadTimestamp": {
|
|
8818
|
-
"type": "bool",
|
|
8819
|
-
"id": 6
|
|
8820
|
-
}
|
|
8821
|
-
}
|
|
8822
|
-
}
|
|
8823
|
-
}
|
|
8824
|
-
},
|
|
8825
|
-
"Transaction": {
|
|
8826
|
-
"fields": {
|
|
8827
|
-
"id": {
|
|
8828
|
-
"type": "bytes",
|
|
8829
|
-
"id": 1
|
|
8830
|
-
},
|
|
8831
|
-
"readTimestamp": {
|
|
8832
|
-
"type": "google.protobuf.Timestamp",
|
|
8833
|
-
"id": 2
|
|
8834
|
-
}
|
|
8835
|
-
}
|
|
8836
|
-
},
|
|
8837
|
-
"TransactionSelector": {
|
|
8838
|
-
"oneofs": {
|
|
8839
|
-
"selector": {
|
|
8840
|
-
"oneof": [
|
|
8841
|
-
"singleUse",
|
|
8842
|
-
"id",
|
|
8843
|
-
"begin"
|
|
8844
|
-
]
|
|
8845
|
-
}
|
|
8846
|
-
},
|
|
8847
|
-
"fields": {
|
|
8848
|
-
"singleUse": {
|
|
8849
|
-
"type": "TransactionOptions",
|
|
8850
|
-
"id": 1
|
|
8851
|
-
},
|
|
8852
|
-
"id": {
|
|
8853
|
-
"type": "bytes",
|
|
8854
|
-
"id": 2
|
|
8855
|
-
},
|
|
8856
|
-
"begin": {
|
|
8857
|
-
"type": "TransactionOptions",
|
|
8858
|
-
"id": 3
|
|
8859
|
-
}
|
|
8860
|
-
}
|
|
8861
|
-
},
|
|
8862
9053
|
"Type": {
|
|
8863
9054
|
"fields": {
|
|
8864
9055
|
"code": {
|
|
@@ -8925,7 +9116,8 @@
|
|
|
8925
9116
|
"NUMERIC": 10,
|
|
8926
9117
|
"JSON": 11,
|
|
8927
9118
|
"PROTO": 13,
|
|
8928
|
-
"ENUM": 14
|
|
9119
|
+
"ENUM": 14,
|
|
9120
|
+
"INTERVAL": 16
|
|
8929
9121
|
}
|
|
8930
9122
|
},
|
|
8931
9123
|
"TypeAnnotationCode": {
|
package/build/src/common.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export declare const CLOUD_RESOURCE_HEADER = "google-cloud-resource-prefix";
|
|
|
49
49
|
* HTTP header to route the requests at Leader
|
|
50
50
|
*/
|
|
51
51
|
export declare const LEADER_AWARE_ROUTING_HEADER = "x-goog-spanner-route-to-leader";
|
|
52
|
+
export declare const END_TO_END_TRACING_HEADER = "x-goog-spanner-end-to-end-tracing";
|
|
52
53
|
/**
|
|
53
54
|
* Add Leader aware routing header to existing header list.
|
|
54
55
|
* @param headers Existing header list.
|
|
@@ -56,3 +57,10 @@ export declare const LEADER_AWARE_ROUTING_HEADER = "x-goog-spanner-route-to-lead
|
|
|
56
57
|
export declare function addLeaderAwareRoutingHeader(headers: {
|
|
57
58
|
[k: string]: string;
|
|
58
59
|
}): void;
|
|
60
|
+
/**
|
|
61
|
+
* Returns common headers to add.
|
|
62
|
+
* @param headers Common header list.
|
|
63
|
+
*/
|
|
64
|
+
export declare function getCommonHeaders(resourceName: string, enableTracing?: boolean): {
|
|
65
|
+
[k: string]: string;
|
|
66
|
+
};
|
package/build/src/common.js
CHANGED
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.LEADER_AWARE_ROUTING_HEADER = exports.CLOUD_RESOURCE_HEADER = void 0;
|
|
18
|
+
exports.END_TO_END_TRACING_HEADER = exports.LEADER_AWARE_ROUTING_HEADER = exports.CLOUD_RESOURCE_HEADER = void 0;
|
|
19
19
|
exports.addLeaderAwareRoutingHeader = addLeaderAwareRoutingHeader;
|
|
20
|
+
exports.getCommonHeaders = getCommonHeaders;
|
|
20
21
|
/*!
|
|
21
22
|
* HTTP header for the resource prefix to improve routing
|
|
22
23
|
* by the backend.
|
|
@@ -26,6 +27,10 @@ exports.CLOUD_RESOURCE_HEADER = 'google-cloud-resource-prefix';
|
|
|
26
27
|
* HTTP header to route the requests at Leader
|
|
27
28
|
*/
|
|
28
29
|
exports.LEADER_AWARE_ROUTING_HEADER = 'x-goog-spanner-route-to-leader';
|
|
30
|
+
/*
|
|
31
|
+
* END TO END TRACING header.
|
|
32
|
+
*/
|
|
33
|
+
exports.END_TO_END_TRACING_HEADER = 'x-goog-spanner-end-to-end-tracing';
|
|
29
34
|
/**
|
|
30
35
|
* Add Leader aware routing header to existing header list.
|
|
31
36
|
* @param headers Existing header list.
|
|
@@ -33,4 +38,17 @@ exports.LEADER_AWARE_ROUTING_HEADER = 'x-goog-spanner-route-to-leader';
|
|
|
33
38
|
function addLeaderAwareRoutingHeader(headers) {
|
|
34
39
|
headers[exports.LEADER_AWARE_ROUTING_HEADER] = 'true';
|
|
35
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns common headers to add.
|
|
43
|
+
* @param headers Common header list.
|
|
44
|
+
*/
|
|
45
|
+
function getCommonHeaders(resourceName, enableTracing) {
|
|
46
|
+
const headers = {};
|
|
47
|
+
if (process.env.SPANNER_ENABLE_END_TO_END_TRACING === 'true' ||
|
|
48
|
+
enableTracing) {
|
|
49
|
+
headers[exports.END_TO_END_TRACING_HEADER] = 'true';
|
|
50
|
+
}
|
|
51
|
+
headers[exports.CLOUD_RESOURCE_HEADER] = resourceName;
|
|
52
|
+
return headers;
|
|
53
|
+
}
|
|
36
54
|
//# sourceMappingURL=common.js.map
|
package/build/src/database.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ declare const common: any;
|
|
|
18
18
|
import * as r from 'teeny-request';
|
|
19
19
|
import { CallOptions, Operation as GaxOperation } from 'google-gax';
|
|
20
20
|
import { BatchTransaction, TransactionIdentifier } from './batch-transaction';
|
|
21
|
+
import { SessionFactoryInterface } from './session-factory';
|
|
21
22
|
import { google as databaseAdmin, google, google as spannerClient } from '../protos/protos';
|
|
22
23
|
import { GetDatabaseOperationsOptions, GetDatabaseOperationsResponse, Instance, GetDatabaseOperationsCallback } from './instance';
|
|
23
24
|
import { PartialResultStream } from './partial-result-stream';
|
|
@@ -104,6 +105,7 @@ export interface CreateSessionOptions {
|
|
|
104
105
|
} | null;
|
|
105
106
|
databaseRole?: string | null;
|
|
106
107
|
gaxOptions?: CallOptions;
|
|
108
|
+
multiplexed?: boolean;
|
|
107
109
|
}
|
|
108
110
|
export interface GetIamPolicyOptions {
|
|
109
111
|
requestedPolicyVersion?: number | null;
|
|
@@ -166,15 +168,20 @@ export interface RestoreOptions {
|
|
|
166
168
|
* ```
|
|
167
169
|
*/
|
|
168
170
|
declare class Database extends common.GrpcServiceObject {
|
|
171
|
+
static [x: string]: any;
|
|
169
172
|
private instance;
|
|
170
173
|
formattedName_: string;
|
|
171
174
|
pool_: SessionPoolInterface;
|
|
175
|
+
sessionFactory_: SessionFactoryInterface;
|
|
172
176
|
queryOptions_?: spannerClient.spanner.v1.ExecuteSqlRequest.IQueryOptions;
|
|
173
|
-
|
|
177
|
+
commonHeaders_: {
|
|
174
178
|
[k: string]: string;
|
|
175
179
|
};
|
|
176
180
|
request: DatabaseRequest;
|
|
177
181
|
databaseRole?: string | null;
|
|
182
|
+
labels?: {
|
|
183
|
+
[k: string]: string;
|
|
184
|
+
} | null;
|
|
178
185
|
databaseDialect?: EnumKey<typeof databaseAdmin.spanner.admin.database.v1.DatabaseDialect> | null;
|
|
179
186
|
_observabilityOptions?: ObservabilityOptions;
|
|
180
187
|
private _traceConfig;
|