@google-cloud/spanner 8.9.0 → 8.11.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/build/protos/status.json +243 -0
- package/build/src/backup.d.ts +2 -1
- package/build/src/batch-transaction.d.ts +2 -1
- package/build/src/codec.d.ts +2 -1
- package/build/src/codec.js +21 -20
- package/build/src/common.d.ts +3 -2
- package/build/src/database.d.ts +5 -2
- package/build/src/index.d.ts +3 -2
- package/build/src/index.js +7 -16
- package/build/src/instance-config.d.ts +2 -1
- package/build/src/instance.d.ts +4 -3
- package/build/src/instance.js +3 -2
- package/build/src/partial-result-stream.d.ts +2 -1
- package/build/src/partial-result-stream.js +5 -4
- package/build/src/protos.d.ts +21 -0
- package/build/src/protos.js +52 -0
- package/build/src/session.d.ts +2 -1
- package/build/src/spanner_grpc_config.json +1 -1
- package/build/src/table.d.ts +3 -2
- package/build/src/table.js +4 -3
- package/build/src/transaction-runner.d.ts +2 -1
- package/build/src/transaction-runner.js +6 -8
- package/build/src/transaction.d.ts +3 -2
- package/build/src/transaction.js +6 -5
- package/build/src/v1/index.d.ts +1 -4
- package/build/src/v1/index.js +5 -8
- package/package.json +8 -6
- package/build/protos/google/spanner/admin/database/v1/backup.proto +0 -773
- package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +0 -230
- package/build/protos/google/spanner/admin/database/v1/common.proto +0 -132
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +0 -1314
- package/build/protos/google/spanner/admin/instance/v1/common.proto +0 -64
- package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +0 -2184
- package/build/protos/google/spanner/executor/v1/cloud_executor.proto +0 -1604
- package/build/protos/google/spanner/v1/change_stream.proto +0 -451
- package/build/protos/google/spanner/v1/commit_response.proto +0 -80
- package/build/protos/google/spanner/v1/keys.proto +0 -163
- package/build/protos/google/spanner/v1/location.proto +0 -388
- package/build/protos/google/spanner/v1/mutation.proto +0 -156
- package/build/protos/google/spanner/v1/query_plan.proto +0 -156
- package/build/protos/google/spanner/v1/result_set.proto +0 -260
- package/build/protos/google/spanner/v1/spanner.proto +0 -1472
- package/build/protos/google/spanner/v1/transaction.proto +0 -329
- package/build/protos/google/spanner/v1/type.proto +0 -214
- package/build/protos/protos.d.ts +0 -44031
- package/build/protos/protos.js +0 -122630
- package/build/protos/protos.json +0 -11631
- package/build/src/v1/database_admin_client.d.ts +0 -2367
- package/build/src/v1/database_admin_client.js +0 -2914
- package/build/src/v1/database_admin_client_config.json +0 -169
- package/build/src/v1/database_admin_proto_list.json +0 -6
- package/build/src/v1/gapic_metadata.json +0 -27
- package/build/src/v1/instance_admin_client.d.ts +0 -2106
- package/build/src/v1/instance_admin_client.js +0 -2387
- package/build/src/v1/instance_admin_client_config.json +0 -129
- package/build/src/v1/instance_admin_proto_list.json +0 -4
- package/build/src/v1/spanner_client.d.ts +0 -1319
- package/build/src/v1/spanner_client.js +0 -1446
- package/build/src/v1/spanner_client_config.json +0 -123
- package/build/src/v1/spanner_executor_proxy_client.d.ts +0 -419
- package/build/src/v1/spanner_executor_proxy_client.js +0 -728
- package/build/src/v1/spanner_executor_proxy_client_config.json +0 -30
- package/build/src/v1/spanner_executor_proxy_proto_list.json +0 -15
- package/build/src/v1/spanner_proto_list.json +0 -12
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
{
|
|
2
|
+
"nested": {
|
|
3
|
+
"google": {
|
|
4
|
+
"nested": {
|
|
5
|
+
"protobuf": {
|
|
6
|
+
"nested": {
|
|
7
|
+
"Any": {
|
|
8
|
+
"fields": {
|
|
9
|
+
"type_url": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"id": 1
|
|
12
|
+
},
|
|
13
|
+
"value": {
|
|
14
|
+
"type": "bytes",
|
|
15
|
+
"id": 2
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"Duration": {
|
|
20
|
+
"fields": {
|
|
21
|
+
"seconds": {
|
|
22
|
+
"type": "int64",
|
|
23
|
+
"id": 1
|
|
24
|
+
},
|
|
25
|
+
"nanos": {
|
|
26
|
+
"type": "int32",
|
|
27
|
+
"id": 2
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"rpc": {
|
|
34
|
+
"options": {
|
|
35
|
+
"cc_enable_arenas": true,
|
|
36
|
+
"go_package": "google.golang.org/genproto/googleapis/rpc/errdetails;errdetails",
|
|
37
|
+
"java_multiple_files": true,
|
|
38
|
+
"java_outer_classname": "ErrorDetailsProto",
|
|
39
|
+
"java_package": "com.google.rpc",
|
|
40
|
+
"objc_class_prefix": "RPC"
|
|
41
|
+
},
|
|
42
|
+
"nested": {
|
|
43
|
+
"Status": {
|
|
44
|
+
"fields": {
|
|
45
|
+
"code": {
|
|
46
|
+
"type": "int32",
|
|
47
|
+
"id": 1
|
|
48
|
+
},
|
|
49
|
+
"message": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"id": 2
|
|
52
|
+
},
|
|
53
|
+
"details": {
|
|
54
|
+
"rule": "repeated",
|
|
55
|
+
"type": "google.protobuf.Any",
|
|
56
|
+
"id": 3
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"RetryInfo": {
|
|
61
|
+
"fields": {
|
|
62
|
+
"retryDelay": {
|
|
63
|
+
"type": "google.protobuf.Duration",
|
|
64
|
+
"id": 1
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"DebugInfo": {
|
|
69
|
+
"fields": {
|
|
70
|
+
"stackEntries": {
|
|
71
|
+
"rule": "repeated",
|
|
72
|
+
"type": "string",
|
|
73
|
+
"id": 1
|
|
74
|
+
},
|
|
75
|
+
"detail": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"id": 2
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"QuotaFailure": {
|
|
82
|
+
"fields": {
|
|
83
|
+
"violations": {
|
|
84
|
+
"rule": "repeated",
|
|
85
|
+
"type": "Violation",
|
|
86
|
+
"id": 1
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"nested": {
|
|
90
|
+
"Violation": {
|
|
91
|
+
"fields": {
|
|
92
|
+
"subject": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"id": 1
|
|
95
|
+
},
|
|
96
|
+
"description": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"id": 2
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"ErrorInfo": {
|
|
105
|
+
"fields": {
|
|
106
|
+
"reason": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"id": 1
|
|
109
|
+
},
|
|
110
|
+
"domain": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"id": 2
|
|
113
|
+
},
|
|
114
|
+
"metadata": {
|
|
115
|
+
"keyType": "string",
|
|
116
|
+
"type": "string",
|
|
117
|
+
"id": 3
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"PreconditionFailure": {
|
|
122
|
+
"fields": {
|
|
123
|
+
"violations": {
|
|
124
|
+
"rule": "repeated",
|
|
125
|
+
"type": "Violation",
|
|
126
|
+
"id": 1
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"nested": {
|
|
130
|
+
"Violation": {
|
|
131
|
+
"fields": {
|
|
132
|
+
"type": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"id": 1
|
|
135
|
+
},
|
|
136
|
+
"subject": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"id": 2
|
|
139
|
+
},
|
|
140
|
+
"description": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"id": 3
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"BadRequest": {
|
|
149
|
+
"fields": {
|
|
150
|
+
"fieldViolations": {
|
|
151
|
+
"rule": "repeated",
|
|
152
|
+
"type": "FieldViolation",
|
|
153
|
+
"id": 1
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"nested": {
|
|
157
|
+
"FieldViolation": {
|
|
158
|
+
"fields": {
|
|
159
|
+
"field": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"id": 1
|
|
162
|
+
},
|
|
163
|
+
"description": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"id": 2
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"RequestInfo": {
|
|
172
|
+
"fields": {
|
|
173
|
+
"requestId": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"id": 1
|
|
176
|
+
},
|
|
177
|
+
"servingData": {
|
|
178
|
+
"type": "string",
|
|
179
|
+
"id": 2
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"ResourceInfo": {
|
|
184
|
+
"fields": {
|
|
185
|
+
"resourceType": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"id": 1
|
|
188
|
+
},
|
|
189
|
+
"resourceName": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"id": 2
|
|
192
|
+
},
|
|
193
|
+
"owner": {
|
|
194
|
+
"type": "string",
|
|
195
|
+
"id": 3
|
|
196
|
+
},
|
|
197
|
+
"description": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"id": 4
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"Help": {
|
|
204
|
+
"fields": {
|
|
205
|
+
"links": {
|
|
206
|
+
"rule": "repeated",
|
|
207
|
+
"type": "Link",
|
|
208
|
+
"id": 1
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"nested": {
|
|
212
|
+
"Link": {
|
|
213
|
+
"fields": {
|
|
214
|
+
"description": {
|
|
215
|
+
"type": "string",
|
|
216
|
+
"id": 1
|
|
217
|
+
},
|
|
218
|
+
"url": {
|
|
219
|
+
"type": "string",
|
|
220
|
+
"id": 2
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"LocalizedMessage": {
|
|
227
|
+
"fields": {
|
|
228
|
+
"locale": {
|
|
229
|
+
"type": "string",
|
|
230
|
+
"id": 1
|
|
231
|
+
},
|
|
232
|
+
"message": {
|
|
233
|
+
"type": "string",
|
|
234
|
+
"id": 2
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
package/build/src/backup.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ import { IOperation, LongRunningCallback, RequestCallback, ResourceCallback, Nor
|
|
|
17
17
|
import { EnumKey, RequestConfig, TranslateEnumKeys } from '.';
|
|
18
18
|
import { CallOptions, Metadata, Operation as GaxOperation } from 'google-gax';
|
|
19
19
|
import { PreciseDate } from '@google-cloud/precise-date';
|
|
20
|
-
import {
|
|
20
|
+
import { protos } from '@google-cloud/spanner-api';
|
|
21
|
+
import databaseAdmin = protos.google;
|
|
21
22
|
import { common as p } from 'protobufjs';
|
|
22
23
|
export type CreateBackupCallback = LongRunningCallback<Backup>;
|
|
23
24
|
export type CopyBackupCallback = LongRunningCallback<Backup>;
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { ExecuteSqlRequest, ReadCallback, ReadRequest, ReadResponse, RunCallback, RunResponse, Snapshot } from './transaction';
|
|
17
|
-
import {
|
|
17
|
+
import { protos } from '@google-cloud/spanner-api';
|
|
18
|
+
import google = protos.google;
|
|
18
19
|
import { Session } from '.';
|
|
19
20
|
import { ResourceCallback } from '../src/common';
|
|
20
21
|
export interface TransactionIdentifier {
|
package/build/src/codec.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Big } from 'big.js';
|
|
2
2
|
import { common as p } from 'protobufjs';
|
|
3
|
-
import {
|
|
3
|
+
import { protos } from '@google-cloud/spanner-api';
|
|
4
|
+
import spannerClient = protos.google;
|
|
4
5
|
export type Value = any;
|
|
5
6
|
export interface Field {
|
|
6
7
|
name: string;
|
package/build/src/codec.js
CHANGED
|
@@ -21,7 +21,8 @@ const service_1 = require("./common-grpc/service");
|
|
|
21
21
|
const precise_date_1 = require("@google-cloud/precise-date");
|
|
22
22
|
const helper_1 = require("./helper");
|
|
23
23
|
const big_js_1 = require("big.js");
|
|
24
|
-
const
|
|
24
|
+
const spanner_api_1 = require("@google-cloud/spanner-api");
|
|
25
|
+
var spannerClient = spanner_api_1.protos.google;
|
|
25
26
|
const google_gax_1 = require("google-gax");
|
|
26
27
|
const DATE_REGEX = /^\d{4}-\d{1,2}-\d{1,2}/;
|
|
27
28
|
const DIGITS_REGEX = /^\d+$/;
|
|
@@ -724,11 +725,11 @@ function getDecoder(type, columnMetadata, options) {
|
|
|
724
725
|
}
|
|
725
726
|
let decoder;
|
|
726
727
|
switch (type.code) {
|
|
727
|
-
case
|
|
728
|
+
case spannerClient.spanner.v1.TypeCode.BYTES:
|
|
728
729
|
case 'BYTES':
|
|
729
730
|
decoder = val => Buffer.from(val, 'base64');
|
|
730
731
|
break;
|
|
731
|
-
case
|
|
732
|
+
case spannerClient.spanner.v1.TypeCode.PROTO:
|
|
732
733
|
case 'PROTO':
|
|
733
734
|
if (jsonMode) {
|
|
734
735
|
decoder = val => {
|
|
@@ -750,7 +751,7 @@ function getDecoder(type, columnMetadata, options) {
|
|
|
750
751
|
};
|
|
751
752
|
}
|
|
752
753
|
break;
|
|
753
|
-
case
|
|
754
|
+
case spannerClient.spanner.v1.TypeCode.ENUM:
|
|
754
755
|
case 'ENUM':
|
|
755
756
|
if (jsonMode) {
|
|
756
757
|
decoder = val => {
|
|
@@ -787,18 +788,18 @@ function getDecoder(type, columnMetadata, options) {
|
|
|
787
788
|
});
|
|
788
789
|
}
|
|
789
790
|
break;
|
|
790
|
-
case
|
|
791
|
+
case spannerClient.spanner.v1.TypeCode.FLOAT32:
|
|
791
792
|
case 'FLOAT32':
|
|
792
793
|
decoder = wrapNumbers ? val => new Float32(val) : val => Number(val);
|
|
793
794
|
break;
|
|
794
|
-
case
|
|
795
|
+
case spannerClient.spanner.v1.TypeCode.FLOAT64:
|
|
795
796
|
case 'FLOAT64':
|
|
796
797
|
decoder = wrapNumbers ? val => new Float(val) : val => Number(val);
|
|
797
798
|
break;
|
|
798
|
-
case
|
|
799
|
+
case spannerClient.spanner.v1.TypeCode.INT64:
|
|
799
800
|
case 'INT64':
|
|
800
801
|
if (type.typeAnnotation ===
|
|
801
|
-
|
|
802
|
+
spannerClient.spanner.v1.TypeAnnotationCode.PG_OID ||
|
|
802
803
|
type.typeAnnotation === 'PG_OID') {
|
|
803
804
|
decoder = wrapNumbers
|
|
804
805
|
? val => new PGOid(val)
|
|
@@ -822,10 +823,10 @@ function getDecoder(type, columnMetadata, options) {
|
|
|
822
823
|
};
|
|
823
824
|
}
|
|
824
825
|
break;
|
|
825
|
-
case
|
|
826
|
+
case spannerClient.spanner.v1.TypeCode.NUMERIC:
|
|
826
827
|
case 'NUMERIC':
|
|
827
828
|
if (type.typeAnnotation ===
|
|
828
|
-
|
|
829
|
+
spannerClient.spanner.v1.TypeAnnotationCode.PG_NUMERIC ||
|
|
829
830
|
type.typeAnnotation === 'PG_NUMERIC') {
|
|
830
831
|
decoder = val => new PGNumeric(val);
|
|
831
832
|
}
|
|
@@ -833,18 +834,18 @@ function getDecoder(type, columnMetadata, options) {
|
|
|
833
834
|
decoder = val => new Numeric(val);
|
|
834
835
|
}
|
|
835
836
|
break;
|
|
836
|
-
case
|
|
837
|
+
case spannerClient.spanner.v1.TypeCode.TIMESTAMP:
|
|
837
838
|
case 'TIMESTAMP':
|
|
838
839
|
decoder = val => parsePreciseDate(val);
|
|
839
840
|
break;
|
|
840
|
-
case
|
|
841
|
+
case spannerClient.spanner.v1.TypeCode.DATE:
|
|
841
842
|
case 'DATE':
|
|
842
843
|
decoder = val => new SpannerDate(val);
|
|
843
844
|
break;
|
|
844
|
-
case
|
|
845
|
+
case spannerClient.spanner.v1.TypeCode.JSON:
|
|
845
846
|
case 'JSON':
|
|
846
847
|
if (type.typeAnnotation ===
|
|
847
|
-
|
|
848
|
+
spannerClient.spanner.v1.TypeAnnotationCode.PG_JSONB ||
|
|
848
849
|
type.typeAnnotation === 'PG_JSONB') {
|
|
849
850
|
decoder = val => new PGJsonb(val);
|
|
850
851
|
}
|
|
@@ -852,17 +853,17 @@ function getDecoder(type, columnMetadata, options) {
|
|
|
852
853
|
decoder = val => JSON.parse(val);
|
|
853
854
|
}
|
|
854
855
|
break;
|
|
855
|
-
case
|
|
856
|
+
case spannerClient.spanner.v1.TypeCode.INTERVAL:
|
|
856
857
|
case 'INTERVAL':
|
|
857
858
|
decoder = val => Interval.fromISO8601(val);
|
|
858
859
|
break;
|
|
859
|
-
case
|
|
860
|
+
case spannerClient.spanner.v1.TypeCode.ARRAY:
|
|
860
861
|
case 'ARRAY': {
|
|
861
862
|
const elementDecoder = getDecoder(type.arrayElementType, columnMetadata, options);
|
|
862
863
|
decoder = val => val.map(elementDecoder);
|
|
863
864
|
break;
|
|
864
865
|
}
|
|
865
|
-
case
|
|
866
|
+
case spannerClient.spanner.v1.TypeCode.STRUCT:
|
|
866
867
|
case 'STRUCT': {
|
|
867
868
|
const includeNameless = options?.includeNameless === true;
|
|
868
869
|
const fields = type.structType.fields;
|
|
@@ -1296,13 +1297,13 @@ function createTypeObject(friendlyType) {
|
|
|
1296
1297
|
}
|
|
1297
1298
|
if (friendlyType.type === 'pgNumeric') {
|
|
1298
1299
|
type.typeAnnotation =
|
|
1299
|
-
|
|
1300
|
+
spannerClient.spanner.v1.TypeAnnotationCode.PG_NUMERIC;
|
|
1300
1301
|
}
|
|
1301
1302
|
else if (friendlyType.type === 'jsonb') {
|
|
1302
|
-
type.typeAnnotation =
|
|
1303
|
+
type.typeAnnotation = spannerClient.spanner.v1.TypeAnnotationCode.PG_JSONB;
|
|
1303
1304
|
}
|
|
1304
1305
|
else if (friendlyType.type === 'pgOid') {
|
|
1305
|
-
type.typeAnnotation =
|
|
1306
|
+
type.typeAnnotation = spannerClient.spanner.v1.TypeAnnotationCode.PG_OID;
|
|
1306
1307
|
}
|
|
1307
1308
|
return type;
|
|
1308
1309
|
}
|
package/build/src/common.d.ts
CHANGED
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { grpc, CallOptions, Operation as GaxOperation } from 'google-gax';
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
17
|
+
import { protos } from '@google-cloud/spanner-api';
|
|
18
|
+
import instanceAdmin = protos.google;
|
|
19
|
+
import databaseAdmin = protos.google;
|
|
19
20
|
export type IOperation = instanceAdmin.longrunning.IOperation;
|
|
20
21
|
export type Schema = string | string[] | databaseAdmin.spanner.admin.database.v1.IUpdateDatabaseDdlRequest;
|
|
21
22
|
export interface ResourceCallback<Resource, Response> {
|
package/build/src/database.d.ts
CHANGED
|
@@ -19,7 +19,10 @@ 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
21
|
import { SessionFactoryInterface } from './session-factory';
|
|
22
|
-
import {
|
|
22
|
+
import { protos } from '@google-cloud/spanner-api';
|
|
23
|
+
import google = protos.google;
|
|
24
|
+
import databaseAdmin = protos.google;
|
|
25
|
+
import spannerClient = protos.google;
|
|
23
26
|
import IsolationLevel = google.spanner.v1.TransactionOptions.IsolationLevel;
|
|
24
27
|
import ReadLockMode = google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode;
|
|
25
28
|
import { GetDatabaseOperationsOptions, GetDatabaseOperationsResponse, Instance, GetDatabaseOperationsCallback } from './instance';
|
|
@@ -256,7 +259,7 @@ declare class Database extends common.GrpcServiceObject {
|
|
|
256
259
|
setMetadata(metadata: IDatabase, gaxOptions?: CallOptions): Promise<SetDatabaseMetadataResponse>;
|
|
257
260
|
setMetadata(metadata: IDatabase, callback: SetDatabaseMetadataCallback): void;
|
|
258
261
|
setMetadata(metadata: IDatabase, gaxOptions: CallOptions, callback: SetDatabaseMetadataCallback): void;
|
|
259
|
-
static getEnvironmentQueryOptions():
|
|
262
|
+
static getEnvironmentQueryOptions(): google.spanner.v1.ExecuteSqlRequest.IQueryOptions;
|
|
260
263
|
/**
|
|
261
264
|
* @typedef {object} BatchCreateSessionsOptions
|
|
262
265
|
* @property {number} count The number of sessions to create.
|
package/build/src/index.d.ts
CHANGED
|
@@ -23,7 +23,9 @@ import { Database } from './database';
|
|
|
23
23
|
import { Instance, CreateInstanceCallback, CreateInstanceResponse } from './instance';
|
|
24
24
|
import { InstanceConfig, CreateInstanceConfigCallback, CreateInstanceConfigResponse } from './instance-config';
|
|
25
25
|
import { grpc, GrpcClientOptions, CallOptions } from 'google-gax';
|
|
26
|
-
import {
|
|
26
|
+
import { protos } from '@google-cloud/spanner-api';
|
|
27
|
+
import google = protos.google;
|
|
28
|
+
import instanceAdmin = protos.google;
|
|
27
29
|
import { PagedOptions, PagedResponse, PagedCallback, PagedOptionsWithFilter, NormalCallback } from './common';
|
|
28
30
|
import { Session } from './session';
|
|
29
31
|
import { SessionPool } from './session-pool';
|
|
@@ -1247,7 +1249,6 @@ export { MutationSet };
|
|
|
1247
1249
|
* @property {constructor} SpannerClient
|
|
1248
1250
|
* Reference to {@link v1.SpannerClient}
|
|
1249
1251
|
*/
|
|
1250
|
-
import * as protos from '../protos/protos';
|
|
1251
1252
|
import IInstanceConfig = instanceAdmin.spanner.admin.instance.v1.IInstanceConfig;
|
|
1252
1253
|
import { RunTransactionOptions } from './transaction-runner';
|
|
1253
1254
|
export { v1, protos };
|
package/build/src/index.js
CHANGED
|
@@ -44,9 +44,11 @@ Object.defineProperty(exports, "Instance", { enumerable: true, get: function ()
|
|
|
44
44
|
const instance_config_1 = require("./instance-config");
|
|
45
45
|
Object.defineProperty(exports, "InstanceConfig", { enumerable: true, get: function () { return instance_config_1.InstanceConfig; } });
|
|
46
46
|
const google_gax_1 = require("google-gax");
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
var
|
|
47
|
+
const spanner_api_1 = require("@google-cloud/spanner-api");
|
|
48
|
+
Object.defineProperty(exports, "protos", { enumerable: true, get: function () { return spanner_api_1.protos; } });
|
|
49
|
+
var google = spanner_api_1.protos.google;
|
|
50
|
+
var IsolationLevel = google.spanner.v1.TransactionOptions.IsolationLevel;
|
|
51
|
+
var ReadLockMode = google.spanner.v1.TransactionOptions.ReadWrite.ReadLockMode;
|
|
50
52
|
const common_1 = require("./common");
|
|
51
53
|
const session_1 = require("./session");
|
|
52
54
|
Object.defineProperty(exports, "Session", { enumerable: true, get: function () { return session_1.Session; } });
|
|
@@ -174,8 +176,8 @@ class Spanner extends service_1.GrpcService {
|
|
|
174
176
|
* @type {string}
|
|
175
177
|
*/
|
|
176
178
|
static COMMIT_TIMESTAMP = 'spanner.commit_timestamp()';
|
|
177
|
-
static POSTGRESQL =
|
|
178
|
-
static GOOGLE_STANDARD_SQL =
|
|
179
|
+
static POSTGRESQL = google.spanner.admin.database.v1.DatabaseDialect.POSTGRESQL;
|
|
180
|
+
static GOOGLE_STANDARD_SQL = google.spanner.admin.database.v1.DatabaseDialect.GOOGLE_STANDARD_SQL;
|
|
179
181
|
/**
|
|
180
182
|
* Returns whether AFE (Application Frontend Extension) server timing is enabled.
|
|
181
183
|
*
|
|
@@ -1369,16 +1371,5 @@ process.on('beforeExit', () => {
|
|
|
1369
1371
|
'getDatabaseAdminClient',
|
|
1370
1372
|
],
|
|
1371
1373
|
});
|
|
1372
|
-
/**
|
|
1373
|
-
* @type {object}
|
|
1374
|
-
* @property {constructor} DatabaseAdminClient
|
|
1375
|
-
* Reference to {@link v1.DatabaseAdminClient}
|
|
1376
|
-
* @property {constructor} InstanceAdminClient
|
|
1377
|
-
* Reference to {@link v1.InstanceAdminClient}
|
|
1378
|
-
* @property {constructor} SpannerClient
|
|
1379
|
-
* Reference to {@link v1.SpannerClient}
|
|
1380
|
-
*/
|
|
1381
|
-
const protos = require("../protos/protos");
|
|
1382
|
-
exports.protos = protos;
|
|
1383
1374
|
exports.default = { Spanner };
|
|
1384
1375
|
//# sourceMappingURL=index.js.map
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
declare const common: any;
|
|
16
|
-
import {
|
|
16
|
+
import { protos } from '@google-cloud/spanner-api';
|
|
17
|
+
import instanceAdmin = protos.google;
|
|
17
18
|
import { Operation as GaxOperation } from 'google-gax';
|
|
18
19
|
import { LongRunningCallback, RequestCallback, ResourceCallback, NormalCallback } from './common';
|
|
19
20
|
import { GetInstanceConfigCallback, GetInstanceConfigOptions, GetInstanceConfigResponse, RequestConfig, Spanner } from './index';
|
package/build/src/instance.d.ts
CHANGED
|
@@ -22,9 +22,10 @@ import { Duplex } from 'stream';
|
|
|
22
22
|
import { SessionPoolOptions, SessionPool } from './session-pool';
|
|
23
23
|
import { Operation as GaxOperation, CallOptions } from 'google-gax';
|
|
24
24
|
import { Backup, CopyBackupCallback, CopyBackupResponse, CopyBackupOptions } from './backup';
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
import
|
|
25
|
+
import { protos } from '@google-cloud/spanner-api';
|
|
26
|
+
import databaseAdmin = protos.google;
|
|
27
|
+
import instanceAdmin = protos.google;
|
|
28
|
+
import spannerClient = protos.google;
|
|
28
29
|
import { CreateInstanceRequest } from './index';
|
|
29
30
|
import { ObservabilityOptions } from './instrument';
|
|
30
31
|
export type IBackup = databaseAdmin.spanner.admin.database.v1.IBackup;
|
package/build/src/instance.js
CHANGED
|
@@ -26,7 +26,8 @@ const database_1 = require("./database");
|
|
|
26
26
|
const common_1 = require("./common");
|
|
27
27
|
const google_gax_1 = require("google-gax");
|
|
28
28
|
const backup_1 = require("./backup");
|
|
29
|
-
const
|
|
29
|
+
const spanner_api_1 = require("@google-cloud/spanner-api");
|
|
30
|
+
var databaseAdmin = spanner_api_1.protos.google;
|
|
30
31
|
/**
|
|
31
32
|
* The {@link Instance} class represents a [Cloud Spanner
|
|
32
33
|
* instance](https://cloud.google.com/spanner/docs/instances).
|
|
@@ -465,7 +466,7 @@ class Instance extends common.GrpcServiceObject {
|
|
|
465
466
|
const poolOptions = options.poolOptions;
|
|
466
467
|
const poolCtor = options.poolCtor;
|
|
467
468
|
let createStatement = 'CREATE DATABASE `' + name.split('/').pop() + '`';
|
|
468
|
-
if (
|
|
469
|
+
if (databaseAdmin.spanner.admin.database.v1.DatabaseDialect.POSTGRESQL ===
|
|
469
470
|
options.databaseDialect) {
|
|
470
471
|
createStatement = 'CREATE DATABASE "' + name.split('/').pop() + '"';
|
|
471
472
|
}
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
import { Readable, Transform } from 'stream';
|
|
17
17
|
import { CallOptions } from 'google-gax';
|
|
18
18
|
import { JSONOptions, Json, Field, Value } from './codec';
|
|
19
|
-
import {
|
|
19
|
+
import { protos } from '@google-cloud/spanner-api';
|
|
20
|
+
import google = protos.google;
|
|
20
21
|
export type ResumeToken = string | Uint8Array;
|
|
21
22
|
/**
|
|
22
23
|
* @callback RequestFunction
|
|
@@ -26,7 +26,8 @@ const streamEvents = require("stream-events");
|
|
|
26
26
|
const google_gax_1 = require("google-gax");
|
|
27
27
|
const transaction_runner_1 = require("./transaction-runner");
|
|
28
28
|
const codec_1 = require("./codec");
|
|
29
|
-
const
|
|
29
|
+
const spanner_api_1 = require("@google-cloud/spanner-api");
|
|
30
|
+
var google = spanner_api_1.protos.google;
|
|
30
31
|
const stream = require("stream");
|
|
31
32
|
const helper_1 = require("./helper");
|
|
32
33
|
const originalDecode = codec_1.codec.decode;
|
|
@@ -303,9 +304,9 @@ class PartialResultStream extends stream_1.Transform {
|
|
|
303
304
|
*/
|
|
304
305
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
305
306
|
static merge(type, head, tail) {
|
|
306
|
-
if (type.code ===
|
|
307
|
+
if (type.code === google.spanner.v1.TypeCode.ARRAY ||
|
|
307
308
|
type.code === 'ARRAY' ||
|
|
308
|
-
type.code ===
|
|
309
|
+
type.code === google.spanner.v1.TypeCode.STRUCT ||
|
|
309
310
|
type.code === 'STRUCT') {
|
|
310
311
|
if (head === null || tail === null) {
|
|
311
312
|
return [head, tail];
|
|
@@ -331,7 +332,7 @@ class PartialResultStream extends stream_1.Transform {
|
|
|
331
332
|
static mergeLists(type, head, tail) {
|
|
332
333
|
let listType;
|
|
333
334
|
if (type.code === 'ARRAY' ||
|
|
334
|
-
type.code ===
|
|
335
|
+
type.code === google.spanner.v1.TypeCode.ARRAY) {
|
|
335
336
|
listType = type.arrayElementType;
|
|
336
337
|
}
|
|
337
338
|
else {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const RetryInfo: import("protobufjs").Type;
|
|
2
|
+
/**
|
|
3
|
+
* Builds the filesystem path to a particular proto sub-path, for protos
|
|
4
|
+
* stored in `@google-cloud/spanner-api`.
|
|
5
|
+
*
|
|
6
|
+
* @param protoSubPath A sub-path like 'google/spanner', or undefined to get the base path.
|
|
7
|
+
* @returns The requested path.
|
|
8
|
+
*
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
export declare function getProtoPath(protoSubPath?: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Returns the RetryInfo type that was loaded from status.json. This is
|
|
14
|
+
* not included in the spanner-api package, so it's imported here.
|
|
15
|
+
*
|
|
16
|
+
* @returns The RetryInfo type.
|
|
17
|
+
*
|
|
18
|
+
* @private
|
|
19
|
+
*/
|
|
20
|
+
export declare function getRetryInfo(): typeof RetryInfo;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2026 Google LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.getProtoPath = getProtoPath;
|
|
17
|
+
exports.getRetryInfo = getRetryInfo;
|
|
18
|
+
const path = require("node:path");
|
|
19
|
+
const API_PATH = path.dirname(require.resolve('@google-cloud/spanner-api/package.json'));
|
|
20
|
+
const IMPORT_PATH = path.join(API_PATH, 'build/protos');
|
|
21
|
+
const protobufjs_1 = require("protobufjs");
|
|
22
|
+
const statusProtoJson = require('../protos/status.json');
|
|
23
|
+
const RetryInfo = protobufjs_1.Root.fromJSON(statusProtoJson).lookupType('google.rpc.RetryInfo');
|
|
24
|
+
/**
|
|
25
|
+
* Builds the filesystem path to a particular proto sub-path, for protos
|
|
26
|
+
* stored in `@google-cloud/spanner-api`.
|
|
27
|
+
*
|
|
28
|
+
* @param protoSubPath A sub-path like 'google/spanner', or undefined to get the base path.
|
|
29
|
+
* @returns The requested path.
|
|
30
|
+
*
|
|
31
|
+
* @private
|
|
32
|
+
*/
|
|
33
|
+
function getProtoPath(protoSubPath) {
|
|
34
|
+
if (protoSubPath) {
|
|
35
|
+
return path.join(IMPORT_PATH, protoSubPath);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return IMPORT_PATH;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns the RetryInfo type that was loaded from status.json. This is
|
|
43
|
+
* not included in the spanner-api package, so it's imported here.
|
|
44
|
+
*
|
|
45
|
+
* @returns The RetryInfo type.
|
|
46
|
+
*
|
|
47
|
+
* @private
|
|
48
|
+
*/
|
|
49
|
+
function getRetryInfo() {
|
|
50
|
+
return RetryInfo;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=protos.js.map
|