@google-cloud/spanner 7.2.0 → 7.4.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 +30 -0
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +40 -0
- package/build/protos/google/spanner/v1/spanner.proto +42 -8
- package/build/protos/google/spanner/v1/transaction.proto +17 -1
- package/build/protos/google/spanner/v1/type.proto +18 -0
- package/build/protos/protos.d.ts +304 -29
- package/build/protos/protos.js +1203 -119
- package/build/protos/protos.json +134 -36
- package/build/src/codec.d.ts +10 -0
- package/build/src/codec.js +34 -4
- package/build/src/index.js +2 -1
- package/build/src/partial-result-stream.d.ts +1 -1
- package/build/src/partial-result-stream.js +4 -3
- package/build/src/transaction.d.ts +5 -1
- package/build/src/transaction.js +9 -2
- package/build/src/v1/database_admin_client.d.ts +42 -2
- package/build/src/v1/database_admin_client.js +37 -10
- package/build/src/v1/instance_admin_client.d.ts +11 -2
- package/build/src/v1/instance_admin_client.js +37 -10
- package/build/src/v1/spanner_client.d.ts +34 -5
- package/build/src/v1/spanner_client.js +56 -13
- package/package.json +5 -5
package/build/protos/protos.json
CHANGED
|
@@ -34,6 +34,21 @@
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
+
"Edition": {
|
|
38
|
+
"values": {
|
|
39
|
+
"EDITION_UNKNOWN": 0,
|
|
40
|
+
"EDITION_PROTO2": 998,
|
|
41
|
+
"EDITION_PROTO3": 999,
|
|
42
|
+
"EDITION_2023": 1000,
|
|
43
|
+
"EDITION_2024": 1001,
|
|
44
|
+
"EDITION_1_TEST_ONLY": 1,
|
|
45
|
+
"EDITION_2_TEST_ONLY": 2,
|
|
46
|
+
"EDITION_99997_TEST_ONLY": 99997,
|
|
47
|
+
"EDITION_99998_TEST_ONLY": 99998,
|
|
48
|
+
"EDITION_99999_TEST_ONLY": 99999,
|
|
49
|
+
"EDITION_MAX": 2147483647
|
|
50
|
+
}
|
|
51
|
+
},
|
|
37
52
|
"FileDescriptorProto": {
|
|
38
53
|
"fields": {
|
|
39
54
|
"name": {
|
|
@@ -98,8 +113,8 @@
|
|
|
98
113
|
"id": 12
|
|
99
114
|
},
|
|
100
115
|
"edition": {
|
|
101
|
-
"type": "
|
|
102
|
-
"id":
|
|
116
|
+
"type": "Edition",
|
|
117
|
+
"id": 14
|
|
103
118
|
}
|
|
104
119
|
}
|
|
105
120
|
},
|
|
@@ -208,7 +223,8 @@
|
|
|
208
223
|
"type": "VerificationState",
|
|
209
224
|
"id": 3,
|
|
210
225
|
"options": {
|
|
211
|
-
"default": "UNVERIFIED"
|
|
226
|
+
"default": "UNVERIFIED",
|
|
227
|
+
"retention": "RETENTION_SOURCE"
|
|
212
228
|
}
|
|
213
229
|
}
|
|
214
230
|
},
|
|
@@ -330,8 +346,8 @@
|
|
|
330
346
|
"Label": {
|
|
331
347
|
"values": {
|
|
332
348
|
"LABEL_OPTIONAL": 1,
|
|
333
|
-
"
|
|
334
|
-
"
|
|
349
|
+
"LABEL_REPEATED": 3,
|
|
350
|
+
"LABEL_REQUIRED": 2
|
|
335
351
|
}
|
|
336
352
|
}
|
|
337
353
|
}
|
|
@@ -519,13 +535,6 @@
|
|
|
519
535
|
"default": false
|
|
520
536
|
}
|
|
521
537
|
},
|
|
522
|
-
"phpGenericServices": {
|
|
523
|
-
"type": "bool",
|
|
524
|
-
"id": 42,
|
|
525
|
-
"options": {
|
|
526
|
-
"default": false
|
|
527
|
-
}
|
|
528
|
-
},
|
|
529
538
|
"deprecated": {
|
|
530
539
|
"type": "bool",
|
|
531
540
|
"id": 23,
|
|
@@ -585,6 +594,10 @@
|
|
|
585
594
|
]
|
|
586
595
|
],
|
|
587
596
|
"reserved": [
|
|
597
|
+
[
|
|
598
|
+
42,
|
|
599
|
+
42
|
|
600
|
+
],
|
|
588
601
|
[
|
|
589
602
|
38,
|
|
590
603
|
38
|
|
@@ -810,8 +823,8 @@
|
|
|
810
823
|
"EditionDefault": {
|
|
811
824
|
"fields": {
|
|
812
825
|
"edition": {
|
|
813
|
-
"type": "
|
|
814
|
-
"id":
|
|
826
|
+
"type": "Edition",
|
|
827
|
+
"id": 3
|
|
815
828
|
},
|
|
816
829
|
"value": {
|
|
817
830
|
"type": "string",
|
|
@@ -1041,7 +1054,7 @@
|
|
|
1041
1054
|
"options": {
|
|
1042
1055
|
"retention": "RETENTION_RUNTIME",
|
|
1043
1056
|
"targets": "TARGET_TYPE_FILE",
|
|
1044
|
-
"edition_defaults.edition": "
|
|
1057
|
+
"edition_defaults.edition": "EDITION_2023",
|
|
1045
1058
|
"edition_defaults.value": "EXPLICIT"
|
|
1046
1059
|
}
|
|
1047
1060
|
},
|
|
@@ -1051,7 +1064,7 @@
|
|
|
1051
1064
|
"options": {
|
|
1052
1065
|
"retention": "RETENTION_RUNTIME",
|
|
1053
1066
|
"targets": "TARGET_TYPE_FILE",
|
|
1054
|
-
"edition_defaults.edition": "
|
|
1067
|
+
"edition_defaults.edition": "EDITION_PROTO3",
|
|
1055
1068
|
"edition_defaults.value": "OPEN"
|
|
1056
1069
|
}
|
|
1057
1070
|
},
|
|
@@ -1061,18 +1074,18 @@
|
|
|
1061
1074
|
"options": {
|
|
1062
1075
|
"retention": "RETENTION_RUNTIME",
|
|
1063
1076
|
"targets": "TARGET_TYPE_FILE",
|
|
1064
|
-
"edition_defaults.edition": "
|
|
1077
|
+
"edition_defaults.edition": "EDITION_PROTO3",
|
|
1065
1078
|
"edition_defaults.value": "PACKED"
|
|
1066
1079
|
}
|
|
1067
1080
|
},
|
|
1068
|
-
"
|
|
1069
|
-
"type": "
|
|
1081
|
+
"utf8Validation": {
|
|
1082
|
+
"type": "Utf8Validation",
|
|
1070
1083
|
"id": 4,
|
|
1071
1084
|
"options": {
|
|
1072
1085
|
"retention": "RETENTION_RUNTIME",
|
|
1073
1086
|
"targets": "TARGET_TYPE_FILE",
|
|
1074
|
-
"edition_defaults.edition": "
|
|
1075
|
-
"edition_defaults.value": "
|
|
1087
|
+
"edition_defaults.edition": "EDITION_PROTO3",
|
|
1088
|
+
"edition_defaults.value": "VERIFY"
|
|
1076
1089
|
}
|
|
1077
1090
|
},
|
|
1078
1091
|
"messageEncoding": {
|
|
@@ -1081,7 +1094,7 @@
|
|
|
1081
1094
|
"options": {
|
|
1082
1095
|
"retention": "RETENTION_RUNTIME",
|
|
1083
1096
|
"targets": "TARGET_TYPE_FILE",
|
|
1084
|
-
"edition_defaults.edition": "
|
|
1097
|
+
"edition_defaults.edition": "EDITION_PROTO2",
|
|
1085
1098
|
"edition_defaults.value": "LENGTH_PREFIXED"
|
|
1086
1099
|
}
|
|
1087
1100
|
},
|
|
@@ -1091,16 +1104,9 @@
|
|
|
1091
1104
|
"options": {
|
|
1092
1105
|
"retention": "RETENTION_RUNTIME",
|
|
1093
1106
|
"targets": "TARGET_TYPE_FILE",
|
|
1094
|
-
"edition_defaults.edition": "
|
|
1107
|
+
"edition_defaults.edition": "EDITION_PROTO3",
|
|
1095
1108
|
"edition_defaults.value": "ALLOW"
|
|
1096
1109
|
}
|
|
1097
|
-
},
|
|
1098
|
-
"rawFeatures": {
|
|
1099
|
-
"type": "FeatureSet",
|
|
1100
|
-
"id": 999,
|
|
1101
|
-
"options": {
|
|
1102
|
-
"targets": "TARGET_TYPE_UNKNOWN"
|
|
1103
|
-
}
|
|
1104
1110
|
}
|
|
1105
1111
|
},
|
|
1106
1112
|
"extensions": [
|
|
@@ -1117,6 +1123,12 @@
|
|
|
1117
1123
|
9999
|
|
1118
1124
|
]
|
|
1119
1125
|
],
|
|
1126
|
+
"reserved": [
|
|
1127
|
+
[
|
|
1128
|
+
999,
|
|
1129
|
+
999
|
|
1130
|
+
]
|
|
1131
|
+
],
|
|
1120
1132
|
"nested": {
|
|
1121
1133
|
"FieldPresence": {
|
|
1122
1134
|
"values": {
|
|
@@ -1140,11 +1152,10 @@
|
|
|
1140
1152
|
"EXPANDED": 2
|
|
1141
1153
|
}
|
|
1142
1154
|
},
|
|
1143
|
-
"
|
|
1155
|
+
"Utf8Validation": {
|
|
1144
1156
|
"values": {
|
|
1145
|
-
"
|
|
1146
|
-
"
|
|
1147
|
-
"HINT": 2,
|
|
1157
|
+
"UTF8_VALIDATION_UNKNOWN": 0,
|
|
1158
|
+
"VERIFY": 2,
|
|
1148
1159
|
"NONE": 3
|
|
1149
1160
|
}
|
|
1150
1161
|
},
|
|
@@ -1164,6 +1175,37 @@
|
|
|
1164
1175
|
}
|
|
1165
1176
|
}
|
|
1166
1177
|
},
|
|
1178
|
+
"FeatureSetDefaults": {
|
|
1179
|
+
"fields": {
|
|
1180
|
+
"defaults": {
|
|
1181
|
+
"rule": "repeated",
|
|
1182
|
+
"type": "FeatureSetEditionDefault",
|
|
1183
|
+
"id": 1
|
|
1184
|
+
},
|
|
1185
|
+
"minimumEdition": {
|
|
1186
|
+
"type": "Edition",
|
|
1187
|
+
"id": 4
|
|
1188
|
+
},
|
|
1189
|
+
"maximumEdition": {
|
|
1190
|
+
"type": "Edition",
|
|
1191
|
+
"id": 5
|
|
1192
|
+
}
|
|
1193
|
+
},
|
|
1194
|
+
"nested": {
|
|
1195
|
+
"FeatureSetEditionDefault": {
|
|
1196
|
+
"fields": {
|
|
1197
|
+
"edition": {
|
|
1198
|
+
"type": "Edition",
|
|
1199
|
+
"id": 3
|
|
1200
|
+
},
|
|
1201
|
+
"features": {
|
|
1202
|
+
"type": "FeatureSet",
|
|
1203
|
+
"id": 2
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
},
|
|
1167
1209
|
"SourceCodeInfo": {
|
|
1168
1210
|
"fields": {
|
|
1169
1211
|
"location": {
|
|
@@ -2715,6 +2757,13 @@
|
|
|
2715
2757
|
"options": {
|
|
2716
2758
|
"(google.api.field_behavior)": "OPTIONAL"
|
|
2717
2759
|
}
|
|
2760
|
+
},
|
|
2761
|
+
"protoDescriptors": {
|
|
2762
|
+
"type": "bytes",
|
|
2763
|
+
"id": 6,
|
|
2764
|
+
"options": {
|
|
2765
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
2766
|
+
}
|
|
2718
2767
|
}
|
|
2719
2768
|
}
|
|
2720
2769
|
},
|
|
@@ -2796,6 +2845,13 @@
|
|
|
2796
2845
|
"operationId": {
|
|
2797
2846
|
"type": "string",
|
|
2798
2847
|
"id": 3
|
|
2848
|
+
},
|
|
2849
|
+
"protoDescriptors": {
|
|
2850
|
+
"type": "bytes",
|
|
2851
|
+
"id": 4,
|
|
2852
|
+
"options": {
|
|
2853
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
2854
|
+
}
|
|
2799
2855
|
}
|
|
2800
2856
|
}
|
|
2801
2857
|
},
|
|
@@ -2884,6 +2940,10 @@
|
|
|
2884
2940
|
"rule": "repeated",
|
|
2885
2941
|
"type": "string",
|
|
2886
2942
|
"id": 1
|
|
2943
|
+
},
|
|
2944
|
+
"protoDescriptors": {
|
|
2945
|
+
"type": "bytes",
|
|
2946
|
+
"id": 2
|
|
2887
2947
|
}
|
|
2888
2948
|
}
|
|
2889
2949
|
},
|
|
@@ -4402,6 +4462,10 @@
|
|
|
4402
4462
|
"readOnly": {
|
|
4403
4463
|
"type": "ReadOnly",
|
|
4404
4464
|
"id": 2
|
|
4465
|
+
},
|
|
4466
|
+
"excludeTxnFromChangeStreams": {
|
|
4467
|
+
"type": "bool",
|
|
4468
|
+
"id": 5
|
|
4405
4469
|
}
|
|
4406
4470
|
},
|
|
4407
4471
|
"nested": {
|
|
@@ -4523,6 +4587,10 @@
|
|
|
4523
4587
|
"typeAnnotation": {
|
|
4524
4588
|
"type": "TypeAnnotationCode",
|
|
4525
4589
|
"id": 4
|
|
4590
|
+
},
|
|
4591
|
+
"protoTypeFqn": {
|
|
4592
|
+
"type": "string",
|
|
4593
|
+
"id": 5
|
|
4526
4594
|
}
|
|
4527
4595
|
}
|
|
4528
4596
|
},
|
|
@@ -4555,6 +4623,7 @@
|
|
|
4555
4623
|
"BOOL": 1,
|
|
4556
4624
|
"INT64": 2,
|
|
4557
4625
|
"FLOAT64": 3,
|
|
4626
|
+
"FLOAT32": 15,
|
|
4558
4627
|
"TIMESTAMP": 4,
|
|
4559
4628
|
"DATE": 5,
|
|
4560
4629
|
"STRING": 6,
|
|
@@ -4562,7 +4631,9 @@
|
|
|
4562
4631
|
"ARRAY": 8,
|
|
4563
4632
|
"STRUCT": 9,
|
|
4564
4633
|
"NUMERIC": 10,
|
|
4565
|
-
"JSON": 11
|
|
4634
|
+
"JSON": 11,
|
|
4635
|
+
"PROTO": 13,
|
|
4636
|
+
"ENUM": 14
|
|
4566
4637
|
}
|
|
4567
4638
|
},
|
|
4568
4639
|
"TypeAnnotationCode": {
|
|
@@ -4959,6 +5030,13 @@
|
|
|
4959
5030
|
"creatorRole": {
|
|
4960
5031
|
"type": "string",
|
|
4961
5032
|
"id": 5
|
|
5033
|
+
},
|
|
5034
|
+
"multiplexed": {
|
|
5035
|
+
"type": "bool",
|
|
5036
|
+
"id": 6,
|
|
5037
|
+
"options": {
|
|
5038
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
5039
|
+
}
|
|
4962
5040
|
}
|
|
4963
5041
|
}
|
|
4964
5042
|
},
|
|
@@ -5508,6 +5586,13 @@
|
|
|
5508
5586
|
"type": "bool",
|
|
5509
5587
|
"id": 5
|
|
5510
5588
|
},
|
|
5589
|
+
"maxCommitDelay": {
|
|
5590
|
+
"type": "google.protobuf.Duration",
|
|
5591
|
+
"id": 8,
|
|
5592
|
+
"options": {
|
|
5593
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
5594
|
+
}
|
|
5595
|
+
},
|
|
5511
5596
|
"requestOptions": {
|
|
5512
5597
|
"type": "RequestOptions",
|
|
5513
5598
|
"id": 6
|
|
@@ -5554,6 +5639,13 @@
|
|
|
5554
5639
|
"options": {
|
|
5555
5640
|
"(google.api.field_behavior)": "REQUIRED"
|
|
5556
5641
|
}
|
|
5642
|
+
},
|
|
5643
|
+
"excludeTxnFromChangeStreams": {
|
|
5644
|
+
"type": "bool",
|
|
5645
|
+
"id": 5,
|
|
5646
|
+
"options": {
|
|
5647
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
5648
|
+
}
|
|
5557
5649
|
}
|
|
5558
5650
|
},
|
|
5559
5651
|
"nested": {
|
|
@@ -5617,7 +5709,8 @@
|
|
|
5617
5709
|
"INPUT_ONLY": 4,
|
|
5618
5710
|
"IMMUTABLE": 5,
|
|
5619
5711
|
"UNORDERED_LIST": 6,
|
|
5620
|
-
"NON_EMPTY_DEFAULT": 7
|
|
5712
|
+
"NON_EMPTY_DEFAULT": 7,
|
|
5713
|
+
"IDENTIFIER": 8
|
|
5621
5714
|
}
|
|
5622
5715
|
},
|
|
5623
5716
|
"resourceReference": {
|
|
@@ -6018,6 +6111,11 @@
|
|
|
6018
6111
|
"longRunning": {
|
|
6019
6112
|
"type": "LongRunning",
|
|
6020
6113
|
"id": 2
|
|
6114
|
+
},
|
|
6115
|
+
"autoPopulatedFields": {
|
|
6116
|
+
"rule": "repeated",
|
|
6117
|
+
"type": "string",
|
|
6118
|
+
"id": 3
|
|
6021
6119
|
}
|
|
6022
6120
|
},
|
|
6023
6121
|
"nested": {
|
package/build/src/codec.d.ts
CHANGED
|
@@ -139,6 +139,15 @@ export declare class PGJsonb {
|
|
|
139
139
|
constructor(pgValue: object | string);
|
|
140
140
|
toString(): string;
|
|
141
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* @typedef PGOid
|
|
144
|
+
* @see Spanner.pgOid
|
|
145
|
+
*/
|
|
146
|
+
export declare class PGOid extends WrappedNumber {
|
|
147
|
+
value: string;
|
|
148
|
+
constructor(value: string);
|
|
149
|
+
valueOf(): number;
|
|
150
|
+
}
|
|
142
151
|
/**
|
|
143
152
|
* @typedef JSONOptions
|
|
144
153
|
* @property {boolean} [wrapNumbers=false] Indicates if the numbers should be
|
|
@@ -278,6 +287,7 @@ export declare const codec: {
|
|
|
278
287
|
Numeric: typeof Numeric;
|
|
279
288
|
PGNumeric: typeof PGNumeric;
|
|
280
289
|
PGJsonb: typeof PGJsonb;
|
|
290
|
+
PGOid: typeof PGOid;
|
|
281
291
|
convertFieldsToJson: typeof convertFieldsToJson;
|
|
282
292
|
decode: typeof decode;
|
|
283
293
|
encode: typeof encode;
|
package/build/src/codec.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.codec = exports.PGJsonb = exports.PGNumeric = exports.Numeric = exports.Struct = exports.Int = exports.Float = exports.SpannerDate = void 0;
|
|
3
|
+
exports.codec = exports.PGOid = exports.PGJsonb = exports.PGNumeric = exports.Numeric = exports.Struct = exports.Int = exports.Float = exports.SpannerDate = void 0;
|
|
4
4
|
/*!
|
|
5
5
|
* Copyright 2017 Google Inc. All Rights Reserved.
|
|
6
6
|
*
|
|
@@ -211,6 +211,24 @@ class PGJsonb {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
exports.PGJsonb = PGJsonb;
|
|
214
|
+
/**
|
|
215
|
+
* @typedef PGOid
|
|
216
|
+
* @see Spanner.pgOid
|
|
217
|
+
*/
|
|
218
|
+
class PGOid extends WrappedNumber {
|
|
219
|
+
constructor(value) {
|
|
220
|
+
super();
|
|
221
|
+
this.value = value.toString();
|
|
222
|
+
}
|
|
223
|
+
valueOf() {
|
|
224
|
+
const num = Number(this.value);
|
|
225
|
+
if (num > Number.MAX_SAFE_INTEGER) {
|
|
226
|
+
throw new google_gax_1.GoogleError(`PG.OID ${this.value} is out of bounds.`);
|
|
227
|
+
}
|
|
228
|
+
return num;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
exports.PGOid = PGOid;
|
|
214
232
|
/**
|
|
215
233
|
* @typedef JSONOptions
|
|
216
234
|
* @property {boolean} [wrapNumbers=false] Indicates if the numbers should be
|
|
@@ -312,6 +330,12 @@ function decode(value, type) {
|
|
|
312
330
|
break;
|
|
313
331
|
case protos_1.google.spanner.v1.TypeCode.INT64:
|
|
314
332
|
case 'INT64':
|
|
333
|
+
if (type.typeAnnotation ===
|
|
334
|
+
protos_1.google.spanner.v1.TypeAnnotationCode.PG_OID ||
|
|
335
|
+
type.typeAnnotation === 'PG_OID') {
|
|
336
|
+
decoded = new PGOid(decoded);
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
315
339
|
decoded = new Int(decoded);
|
|
316
340
|
break;
|
|
317
341
|
case protos_1.google.spanner.v1.TypeCode.NUMERIC:
|
|
@@ -425,6 +449,7 @@ const TypeCode = {
|
|
|
425
449
|
unspecified: 'TYPE_CODE_UNSPECIFIED',
|
|
426
450
|
bool: 'BOOL',
|
|
427
451
|
int64: 'INT64',
|
|
452
|
+
pgOid: 'INT64',
|
|
428
453
|
float64: 'FLOAT64',
|
|
429
454
|
numeric: 'NUMERIC',
|
|
430
455
|
pgNumeric: 'NUMERIC',
|
|
@@ -491,12 +516,12 @@ function getType(value) {
|
|
|
491
516
|
if (value instanceof PGJsonb) {
|
|
492
517
|
return { type: 'pgJsonb' };
|
|
493
518
|
}
|
|
519
|
+
if (value instanceof PGOid) {
|
|
520
|
+
return { type: 'pgOid' };
|
|
521
|
+
}
|
|
494
522
|
if (is.boolean(value)) {
|
|
495
523
|
return { type: 'bool' };
|
|
496
524
|
}
|
|
497
|
-
if (is.string(value)) {
|
|
498
|
-
return { type: 'string' };
|
|
499
|
-
}
|
|
500
525
|
if (Buffer.isBuffer(value)) {
|
|
501
526
|
return { type: 'bytes' };
|
|
502
527
|
}
|
|
@@ -530,6 +555,7 @@ function getType(value) {
|
|
|
530
555
|
if (is.object(value)) {
|
|
531
556
|
return { type: 'json' };
|
|
532
557
|
}
|
|
558
|
+
// String type is also returned as unspecified to allow untyped parameters
|
|
533
559
|
return { type: 'unspecified' };
|
|
534
560
|
}
|
|
535
561
|
/**
|
|
@@ -608,6 +634,9 @@ function createTypeObject(friendlyType) {
|
|
|
608
634
|
else if (friendlyType.type === 'jsonb') {
|
|
609
635
|
type.typeAnnotation = protos_1.google.spanner.v1.TypeAnnotationCode.PG_JSONB;
|
|
610
636
|
}
|
|
637
|
+
else if (friendlyType.type === 'pgOid') {
|
|
638
|
+
type.typeAnnotation = protos_1.google.spanner.v1.TypeAnnotationCode.PG_OID;
|
|
639
|
+
}
|
|
611
640
|
return type;
|
|
612
641
|
}
|
|
613
642
|
exports.codec = {
|
|
@@ -621,6 +650,7 @@ exports.codec = {
|
|
|
621
650
|
Numeric,
|
|
622
651
|
PGNumeric,
|
|
623
652
|
PGJsonb,
|
|
653
|
+
PGOid,
|
|
624
654
|
convertFieldsToJson,
|
|
625
655
|
decode,
|
|
626
656
|
encode,
|
package/build/src/index.js
CHANGED
|
@@ -165,7 +165,8 @@ class Spanner extends service_1.GrpcService {
|
|
|
165
165
|
const config = {
|
|
166
166
|
baseUrl: options.apiEndpoint ||
|
|
167
167
|
options.servicePath ||
|
|
168
|
-
|
|
168
|
+
// TODO: for TPC, this needs to support universeDomain
|
|
169
|
+
'spanner.googleapis.com',
|
|
169
170
|
protosDir: path.resolve(__dirname, '../protos'),
|
|
170
171
|
protoServices: {
|
|
171
172
|
Operations: {
|
|
@@ -139,7 +139,7 @@ export declare class PartialResultStream extends Transform implements ResultEven
|
|
|
139
139
|
*/
|
|
140
140
|
_transform(chunk: google.spanner.v1.PartialResultSet, enc: string, next: Function): void;
|
|
141
141
|
private _tryResume;
|
|
142
|
-
|
|
142
|
+
_resetPendingValues(): void;
|
|
143
143
|
/**
|
|
144
144
|
* Manages any chunked values.
|
|
145
145
|
*
|
|
@@ -122,8 +122,7 @@ class PartialResultStream extends stream_1.Transform {
|
|
|
122
122
|
}, timeout);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
this._values = [];
|
|
125
|
+
_resetPendingValues() {
|
|
127
126
|
if (this._pendingValueForResume) {
|
|
128
127
|
this._pendingValue = this._pendingValueForResume;
|
|
129
128
|
}
|
|
@@ -323,7 +322,9 @@ function partialResultStream(requestFn, options) {
|
|
|
323
322
|
});
|
|
324
323
|
};
|
|
325
324
|
const makeRequest = () => {
|
|
326
|
-
|
|
325
|
+
if (is.defined(lastResumeToken) && lastResumeToken.length > 0) {
|
|
326
|
+
partialRSStream._resetPendingValues();
|
|
327
|
+
}
|
|
327
328
|
lastRequestStream = requestFn(lastResumeToken);
|
|
328
329
|
lastRequestStream.on('end', endListener);
|
|
329
330
|
requestsStream.add(lastRequestStream);
|
|
@@ -49,6 +49,7 @@ export interface RequestOptions {
|
|
|
49
49
|
export interface CommitOptions {
|
|
50
50
|
requestOptions?: Pick<IRequestOptions, 'priority'>;
|
|
51
51
|
returnCommitStats?: boolean;
|
|
52
|
+
maxCommitDelay?: spannerClient.protobuf.IDuration;
|
|
52
53
|
gaxOptions?: CallOptions;
|
|
53
54
|
}
|
|
54
55
|
export interface Statement {
|
|
@@ -720,7 +721,7 @@ export declare class Snapshot extends EventEmitter {
|
|
|
720
721
|
* execution statistics for the SQL statement that
|
|
721
722
|
* produced this result set.
|
|
722
723
|
* @property {string} partitionToken The partition token.
|
|
723
|
-
* @property {number} seqno The Sequence number.
|
|
724
|
+
* @property {number} seqno The Sequence number. This option is used internally and will be overridden.
|
|
724
725
|
* @property {string} sql The SQL string.
|
|
725
726
|
* @property {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} [queryOptions]
|
|
726
727
|
* Default query options to use with the database. These options will be
|
|
@@ -1083,6 +1084,9 @@ export declare class Transaction extends Dml {
|
|
|
1083
1084
|
* with the commit request.
|
|
1084
1085
|
* @property {boolean} returnCommitStats Include statistics related to the
|
|
1085
1086
|
* transaction in the {@link CommitResponse}.
|
|
1087
|
+
* @property {spannerClient.proto.IDuration} maxCommitDelay Maximum amount
|
|
1088
|
+
* of delay the commit is willing to incur in order to improve
|
|
1089
|
+
* throughput. Value should be between 0ms and 500ms.
|
|
1086
1090
|
* @property {object} [gaxOptions] The request configuration options,
|
|
1087
1091
|
* See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions}
|
|
1088
1092
|
* for more details.
|
package/build/src/transaction.js
CHANGED
|
@@ -517,7 +517,7 @@ class Snapshot extends events_1.EventEmitter {
|
|
|
517
517
|
* execution statistics for the SQL statement that
|
|
518
518
|
* produced this result set.
|
|
519
519
|
* @property {string} partitionToken The partition token.
|
|
520
|
-
* @property {number} seqno The Sequence number.
|
|
520
|
+
* @property {number} seqno The Sequence number. This option is used internally and will be overridden.
|
|
521
521
|
* @property {string} sql The SQL string.
|
|
522
522
|
* @property {google.spanner.v1.ExecuteSqlRequest.IQueryOptions} [queryOptions]
|
|
523
523
|
* Default query options to use with the database. These options will be
|
|
@@ -781,7 +781,10 @@ class Snapshot extends events_1.EventEmitter {
|
|
|
781
781
|
if (!is.empty(typeMap)) {
|
|
782
782
|
Object.keys(typeMap).forEach(param => {
|
|
783
783
|
const type = typeMap[param];
|
|
784
|
-
|
|
784
|
+
const typeObject = codec_1.codec.createTypeObject(type);
|
|
785
|
+
if (typeObject.code !== 'TYPE_CODE_UNSPECIFIED') {
|
|
786
|
+
paramTypes[param] = codec_1.codec.createTypeObject(type);
|
|
787
|
+
}
|
|
785
788
|
});
|
|
786
789
|
}
|
|
787
790
|
return { params, paramTypes };
|
|
@@ -1104,6 +1107,10 @@ class Transaction extends Dml {
|
|
|
1104
1107
|
options.returnCommitStats) {
|
|
1105
1108
|
reqOpts.returnCommitStats = options.returnCommitStats;
|
|
1106
1109
|
}
|
|
1110
|
+
if ('maxCommitDelay' in options &&
|
|
1111
|
+
options.maxCommitDelay) {
|
|
1112
|
+
reqOpts.maxCommitDelay = options.maxCommitDelay;
|
|
1113
|
+
}
|
|
1107
1114
|
reqOpts.requestOptions = Object.assign(requestOptions || {}, this.requestOptions);
|
|
1108
1115
|
const headers = this.resourceHeader_;
|
|
1109
1116
|
if (this._getSpanner().routeToLeaderEnabled) {
|
|
@@ -22,6 +22,8 @@ export declare class DatabaseAdminClient {
|
|
|
22
22
|
private _gaxGrpc;
|
|
23
23
|
private _protos;
|
|
24
24
|
private _defaults;
|
|
25
|
+
private _universeDomain;
|
|
26
|
+
private _servicePath;
|
|
25
27
|
auth: gax.GoogleAuth;
|
|
26
28
|
descriptors: Descriptors;
|
|
27
29
|
warn: (code: string, message: string, warnType?: string) => void;
|
|
@@ -91,15 +93,22 @@ export declare class DatabaseAdminClient {
|
|
|
91
93
|
}>;
|
|
92
94
|
/**
|
|
93
95
|
* The DNS address for this API service.
|
|
96
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
94
97
|
* @returns {string} The DNS address for this service.
|
|
95
98
|
*/
|
|
96
99
|
static get servicePath(): string;
|
|
97
100
|
/**
|
|
98
|
-
* The DNS address for this API service - same as servicePath
|
|
99
|
-
*
|
|
101
|
+
* The DNS address for this API service - same as servicePath.
|
|
102
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
100
103
|
* @returns {string} The DNS address for this service.
|
|
101
104
|
*/
|
|
102
105
|
static get apiEndpoint(): string;
|
|
106
|
+
/**
|
|
107
|
+
* The DNS address for this API service.
|
|
108
|
+
* @returns {string} The DNS address for this service.
|
|
109
|
+
*/
|
|
110
|
+
get apiEndpoint(): string;
|
|
111
|
+
get universeDomain(): string;
|
|
103
112
|
/**
|
|
104
113
|
* The port for this API service.
|
|
105
114
|
* @returns {number} The default port for this service.
|
|
@@ -400,6 +409,22 @@ export declare class DatabaseAdminClient {
|
|
|
400
409
|
* Google default encryption.
|
|
401
410
|
* @param {google.spanner.admin.database.v1.DatabaseDialect} [request.databaseDialect]
|
|
402
411
|
* Optional. The dialect of the Cloud Spanner Database.
|
|
412
|
+
* @param {Buffer} [request.protoDescriptors]
|
|
413
|
+
* Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements in
|
|
414
|
+
* 'extra_statements' above.
|
|
415
|
+
* Contains a protobuf-serialized
|
|
416
|
+
* [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).
|
|
417
|
+
* To generate it, [install](https://grpc.io/docs/protoc-installation/) and
|
|
418
|
+
* run `protoc` with --include_imports and --descriptor_set_out. For example,
|
|
419
|
+
* to generate for moon/shot/app.proto, run
|
|
420
|
+
* ```
|
|
421
|
+
* $protoc --proto_path=/app_path --proto_path=/lib_path \
|
|
422
|
+
* --include_imports \
|
|
423
|
+
* --descriptor_set_out=descriptors.data \
|
|
424
|
+
* moon/shot/app.proto
|
|
425
|
+
* ```
|
|
426
|
+
* For more details, see protobuffer [self
|
|
427
|
+
* description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
|
|
403
428
|
* @param {object} [options]
|
|
404
429
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
405
430
|
* @returns {Promise} - The promise which resolves to an array.
|
|
@@ -534,6 +559,21 @@ export declare class DatabaseAdminClient {
|
|
|
534
559
|
* underscore. If the named operation already exists,
|
|
535
560
|
* {@link protos.google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl|UpdateDatabaseDdl} returns
|
|
536
561
|
* `ALREADY_EXISTS`.
|
|
562
|
+
* @param {Buffer} [request.protoDescriptors]
|
|
563
|
+
* Optional. Proto descriptors used by CREATE/ALTER PROTO BUNDLE statements.
|
|
564
|
+
* Contains a protobuf-serialized
|
|
565
|
+
* [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto).
|
|
566
|
+
* To generate it, [install](https://grpc.io/docs/protoc-installation/) and
|
|
567
|
+
* run `protoc` with --include_imports and --descriptor_set_out. For example,
|
|
568
|
+
* to generate for moon/shot/app.proto, run
|
|
569
|
+
* ```
|
|
570
|
+
* $protoc --proto_path=/app_path --proto_path=/lib_path \
|
|
571
|
+
* --include_imports \
|
|
572
|
+
* --descriptor_set_out=descriptors.data \
|
|
573
|
+
* moon/shot/app.proto
|
|
574
|
+
* ```
|
|
575
|
+
* For more details, see protobuffer [self
|
|
576
|
+
* description](https://developers.google.com/protocol-buffers/docs/techniques#self-description).
|
|
537
577
|
* @param {object} [options]
|
|
538
578
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
539
579
|
* @returns {Promise} - The promise which resolves to an array.
|