@google-cloud/spanner 8.1.0 → 8.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/build/protos/google/spanner/v1/keys.proto +2 -2
- package/build/protos/google/spanner/v1/mutation.proto +31 -23
- package/build/protos/google/spanner/v1/query_plan.proto +21 -18
- package/build/protos/google/spanner/v1/spanner.proto +198 -204
- package/build/protos/google/spanner/v1/transaction.proto +3 -2
- package/build/protos/protos.d.ts +566 -4
- package/build/protos/protos.js +1958 -22
- package/build/protos/protos.json +242 -25
- package/build/src/database.d.ts +2 -2
- package/build/src/database.js +14 -14
- package/build/src/index.d.ts +5 -3
- package/build/src/index.js +8 -7
- package/build/src/metrics/interceptor.js +3 -1
- package/build/src/multiplexed-session.d.ts +1 -1
- package/build/src/multiplexed-session.js +2 -4
- package/build/src/table.d.ts +2 -0
- package/build/src/table.js +5 -0
- package/build/src/transaction-runner.d.ts +5 -0
- package/build/src/transaction-runner.js +2 -0
- package/build/src/transaction.d.ts +2 -0
- package/build/src/transaction.js +11 -8
- package/build/src/v1/spanner_client.d.ts +155 -159
- package/build/src/v1/spanner_client.js +47 -52
- package/package.json +6 -6
|
@@ -848,6 +848,9 @@ class SpannerClient {
|
|
|
848
848
|
* the size of the returned result set. However, no individual row in the
|
|
849
849
|
* result set can exceed 100 MiB, and no column value can exceed 10 MiB.
|
|
850
850
|
*
|
|
851
|
+
* The query string can be SQL or [Graph Query Language
|
|
852
|
+
* (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro).
|
|
853
|
+
*
|
|
851
854
|
* @param {Object} request
|
|
852
855
|
* The request object that will be sent.
|
|
853
856
|
* @param {string} request.session
|
|
@@ -859,7 +862,7 @@ class SpannerClient {
|
|
|
859
862
|
* transaction with strong concurrency.
|
|
860
863
|
*
|
|
861
864
|
* Standard DML statements require a read-write transaction. To protect
|
|
862
|
-
* against replays, single-use transactions are not supported.
|
|
865
|
+
* against replays, single-use transactions are not supported. The caller
|
|
863
866
|
* must either supply an existing transaction ID or begin a new transaction.
|
|
864
867
|
*
|
|
865
868
|
* Partitioned DML requires an existing Partitioned DML transaction ID.
|
|
@@ -873,19 +876,19 @@ class SpannerClient {
|
|
|
873
876
|
* to the naming requirements of identifiers as specified at
|
|
874
877
|
* https://cloud.google.com/spanner/docs/lexical#identifiers.
|
|
875
878
|
*
|
|
876
|
-
* Parameters can appear anywhere that a literal value is expected.
|
|
879
|
+
* Parameters can appear anywhere that a literal value is expected. The same
|
|
877
880
|
* parameter name can be used more than once, for example:
|
|
878
881
|
*
|
|
879
882
|
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
|
|
880
883
|
*
|
|
881
|
-
* It
|
|
884
|
+
* It's an error to execute a SQL statement with unbound parameters.
|
|
882
885
|
* @param {number[]} request.paramTypes
|
|
883
|
-
* It
|
|
884
|
-
* from a JSON value.
|
|
886
|
+
* It isn't always possible for Cloud Spanner to infer the right SQL type
|
|
887
|
+
* from a JSON value. For example, values of type `BYTES` and values
|
|
885
888
|
* of type `STRING` both appear in
|
|
886
889
|
* {@link protos.google.spanner.v1.ExecuteSqlRequest.params|params} as JSON strings.
|
|
887
890
|
*
|
|
888
|
-
* In these cases,
|
|
891
|
+
* In these cases, you can use `param_types` to specify the exact
|
|
889
892
|
* SQL type for some or all of the SQL statement parameters. See the
|
|
890
893
|
* definition of {@link protos.google.spanner.v1.Type|Type} for more information
|
|
891
894
|
* about SQL types.
|
|
@@ -904,19 +907,19 @@ class SpannerClient {
|
|
|
904
907
|
* be set to
|
|
905
908
|
* {@link protos.google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL|QueryMode.NORMAL}.
|
|
906
909
|
* @param {Buffer} request.partitionToken
|
|
907
|
-
* If present, results
|
|
908
|
-
* previously created using PartitionQuery
|
|
910
|
+
* If present, results are restricted to the specified partition
|
|
911
|
+
* previously created using `PartitionQuery`. There must be an exact
|
|
909
912
|
* match for the values of fields common to this message and the
|
|
910
|
-
* PartitionQueryRequest message used to create this partition_token
|
|
913
|
+
* `PartitionQueryRequest` message used to create this `partition_token`.
|
|
911
914
|
* @param {number} request.seqno
|
|
912
915
|
* A per-transaction sequence number used to identify this request. This field
|
|
913
916
|
* makes each request idempotent such that if the request is received multiple
|
|
914
|
-
* times, at most one
|
|
917
|
+
* times, at most one succeeds.
|
|
915
918
|
*
|
|
916
919
|
* The sequence number must be monotonically increasing within the
|
|
917
920
|
* transaction. If a request arrives for the first time with an out-of-order
|
|
918
|
-
* sequence number, the transaction
|
|
919
|
-
* handled requests
|
|
921
|
+
* sequence number, the transaction can be aborted. Replays of previously
|
|
922
|
+
* handled requests yield the same response as the first execution.
|
|
920
923
|
*
|
|
921
924
|
* Required for DML statements. Ignored for queries.
|
|
922
925
|
* @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} request.queryOptions
|
|
@@ -929,18 +932,18 @@ class SpannerClient {
|
|
|
929
932
|
* If this is for a partitioned query and this field is set to `true`, the
|
|
930
933
|
* request is executed with Spanner Data Boost independent compute resources.
|
|
931
934
|
*
|
|
932
|
-
* If the field is set to `true` but the request
|
|
935
|
+
* If the field is set to `true` but the request doesn't set
|
|
933
936
|
* `partition_token`, the API returns an `INVALID_ARGUMENT` error.
|
|
934
937
|
* @param {boolean} [request.lastStatement]
|
|
935
|
-
* Optional. If set to true
|
|
936
|
-
*
|
|
937
|
-
*
|
|
938
|
-
* transaction (including reads and queries)
|
|
938
|
+
* Optional. If set to `true`, this statement marks the end of the
|
|
939
|
+
* transaction. After this statement executes, you must commit or abort the
|
|
940
|
+
* transaction. Attempts to execute any other requests against this
|
|
941
|
+
* transaction (including reads and queries) are rejected.
|
|
939
942
|
*
|
|
940
|
-
* For DML statements, setting this option
|
|
941
|
-
* be deferred until commit time (
|
|
942
|
-
* Given this, successful execution of a DML statement
|
|
943
|
-
* until a subsequent Commit call completes successfully.
|
|
943
|
+
* For DML statements, setting this option might cause some error reporting to
|
|
944
|
+
* be deferred until commit time (for example, validation of unique
|
|
945
|
+
* constraints). Given this, successful execution of a DML statement shouldn't
|
|
946
|
+
* be assumed until a subsequent `Commit` call completes successfully.
|
|
944
947
|
* @param {object} [options]
|
|
945
948
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
946
949
|
* @returns {Stream}
|
|
@@ -1000,15 +1003,15 @@ class SpannerClient {
|
|
|
1000
1003
|
* If the {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token}
|
|
1001
1004
|
* field is empty, rows are yielded in table primary key order (if
|
|
1002
1005
|
* {@link protos.google.spanner.v1.ReadRequest.index|index} is empty) or index key order
|
|
1003
|
-
* (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty).
|
|
1004
|
-
* {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field
|
|
1005
|
-
*
|
|
1006
|
+
* (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty). If the
|
|
1007
|
+
* {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field
|
|
1008
|
+
* isn't empty, rows are yielded in an unspecified order.
|
|
1006
1009
|
*
|
|
1007
|
-
* It
|
|
1010
|
+
* It isn't an error for the `key_set` to name rows that don't
|
|
1008
1011
|
* exist in the database. Read yields nothing for nonexistent rows.
|
|
1009
1012
|
* @param {number} request.limit
|
|
1010
1013
|
* If greater than zero, only the first `limit` rows are yielded. If `limit`
|
|
1011
|
-
* is zero, the default is no limit. A limit
|
|
1014
|
+
* is zero, the default is no limit. A limit can't be specified if
|
|
1012
1015
|
* `partition_token` is set.
|
|
1013
1016
|
* @param {Buffer} request.resumeToken
|
|
1014
1017
|
* If this request is resuming a previously interrupted read,
|
|
@@ -1018,8 +1021,8 @@ class SpannerClient {
|
|
|
1018
1021
|
* left off. The rest of the request parameters must exactly match the request
|
|
1019
1022
|
* that yielded this token.
|
|
1020
1023
|
* @param {Buffer} request.partitionToken
|
|
1021
|
-
* If present, results
|
|
1022
|
-
* previously created using PartitionRead
|
|
1024
|
+
* If present, results are restricted to the specified partition
|
|
1025
|
+
* previously created using `PartitionRead`. There must be an exact
|
|
1023
1026
|
* match for the values of fields common to this message and the
|
|
1024
1027
|
* PartitionReadRequest message used to create this partition_token.
|
|
1025
1028
|
* @param {google.spanner.v1.RequestOptions} request.requestOptions
|
|
@@ -1030,16 +1033,17 @@ class SpannerClient {
|
|
|
1030
1033
|
* If this is for a partitioned read and this field is set to `true`, the
|
|
1031
1034
|
* request is executed with Spanner Data Boost independent compute resources.
|
|
1032
1035
|
*
|
|
1033
|
-
* If the field is set to `true` but the request
|
|
1036
|
+
* If the field is set to `true` but the request doesn't set
|
|
1034
1037
|
* `partition_token`, the API returns an `INVALID_ARGUMENT` error.
|
|
1035
1038
|
* @param {google.spanner.v1.ReadRequest.OrderBy} [request.orderBy]
|
|
1036
1039
|
* Optional. Order for the returned rows.
|
|
1037
1040
|
*
|
|
1038
|
-
* By default, Spanner
|
|
1039
|
-
* PartitionRead requests. For applications that
|
|
1041
|
+
* By default, Spanner returns result rows in primary key order except for
|
|
1042
|
+
* PartitionRead requests. For applications that don't require rows to be
|
|
1040
1043
|
* returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting
|
|
1041
1044
|
* `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval,
|
|
1042
|
-
* resulting in lower latencies in certain cases (
|
|
1045
|
+
* resulting in lower latencies in certain cases (for example, bulk point
|
|
1046
|
+
* lookups).
|
|
1043
1047
|
* @param {google.spanner.v1.ReadRequest.LockHint} [request.lockHint]
|
|
1044
1048
|
* Optional. Lock Hint for the request, it can only be used with read-write
|
|
1045
1049
|
* transactions.
|
|
@@ -1070,15 +1074,15 @@ class SpannerClient {
|
|
|
1070
1074
|
* transactions. All mutations in a group are committed atomically. However,
|
|
1071
1075
|
* mutations across groups can be committed non-atomically in an unspecified
|
|
1072
1076
|
* order and thus, they must be independent of each other. Partial failure is
|
|
1073
|
-
* possible,
|
|
1074
|
-
* some
|
|
1075
|
-
* the response as the batches are applied.
|
|
1077
|
+
* possible, that is, some groups might have been committed successfully,
|
|
1078
|
+
* while some might have failed. The results of individual batches are
|
|
1079
|
+
* streamed into the response as the batches are applied.
|
|
1076
1080
|
*
|
|
1077
|
-
* BatchWrite requests are not replay protected, meaning that each mutation
|
|
1078
|
-
* group
|
|
1079
|
-
*
|
|
1080
|
-
*
|
|
1081
|
-
* timestamp-based keys, it
|
|
1081
|
+
* `BatchWrite` requests are not replay protected, meaning that each mutation
|
|
1082
|
+
* group can be applied more than once. Replays of non-idempotent mutations
|
|
1083
|
+
* can have undesirable effects. For example, replays of an insert mutation
|
|
1084
|
+
* can produce an already exists error or if you use generated or commit
|
|
1085
|
+
* timestamp-based keys, it can result in additional rows being added to the
|
|
1082
1086
|
* mutation's table. We recommend structuring your mutation groups to be
|
|
1083
1087
|
* idempotent to avoid this issue.
|
|
1084
1088
|
*
|
|
@@ -1091,18 +1095,9 @@ class SpannerClient {
|
|
|
1091
1095
|
* @param {number[]} request.mutationGroups
|
|
1092
1096
|
* Required. The groups of mutations to be applied.
|
|
1093
1097
|
* @param {boolean} [request.excludeTxnFromChangeStreams]
|
|
1094
|
-
* Optional.
|
|
1095
|
-
*
|
|
1096
|
-
*
|
|
1097
|
-
* that are tracking columns modified by these transactions.
|
|
1098
|
-
* * Mutations from all transactions in this batch write operation will be
|
|
1099
|
-
* recorded in change streams with DDL option `allow_txn_exclusion=false or
|
|
1100
|
-
* not set` that are tracking columns modified by these transactions.
|
|
1101
|
-
*
|
|
1102
|
-
* When `exclude_txn_from_change_streams` is set to `false` or not set,
|
|
1103
|
-
* mutations from all transactions in this batch write operation will be
|
|
1104
|
-
* recorded in all change streams that are tracking columns modified by these
|
|
1105
|
-
* transactions.
|
|
1098
|
+
* Optional. If you don't set the `exclude_txn_from_change_streams` option or
|
|
1099
|
+
* if it's set to `false`, then any change streams monitoring columns modified
|
|
1100
|
+
* by transactions will capture the updates made within that transaction.
|
|
1106
1101
|
* @param {object} [options]
|
|
1107
1102
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1108
1103
|
* @returns {Stream}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-cloud/spanner",
|
|
3
3
|
"description": "Cloud Spanner Client Library for Node.js",
|
|
4
|
-
"version": "8.1
|
|
4
|
+
"version": "8.2.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Google Inc.",
|
|
7
7
|
"engines": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@google-cloud/projectify": "^5.0.0",
|
|
62
62
|
"@google-cloud/promisify": "^5.0.0",
|
|
63
63
|
"@grpc/grpc-js": "^1.13.2",
|
|
64
|
-
"@grpc/proto-loader": "^0.
|
|
64
|
+
"@grpc/proto-loader": "^0.8.0",
|
|
65
65
|
"@opentelemetry/api": "^1.9.0",
|
|
66
66
|
"@opentelemetry/context-async-hooks": "^2.0.0",
|
|
67
67
|
"@opentelemetry/core": "^2.0.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"events-intercept": "^2.0.0",
|
|
77
77
|
"extend": "^3.0.2",
|
|
78
78
|
"google-auth-library": "^10.0.0-rc.1",
|
|
79
|
-
"google-gax": "5.0.
|
|
79
|
+
"google-gax": "5.0.3",
|
|
80
80
|
"grpc-gcp": "^1.0.1",
|
|
81
81
|
"lodash.snakecase": "^4.1.1",
|
|
82
82
|
"merge-stream": "^2.0.0",
|
|
@@ -90,7 +90,8 @@
|
|
|
90
90
|
"through2": "^4.0.2",
|
|
91
91
|
"@babel/traverse": "7.27.7",
|
|
92
92
|
"@babel/core": "7.27.7",
|
|
93
|
-
"@babel/helpers": "7.27.6"
|
|
93
|
+
"@babel/helpers": "7.27.6",
|
|
94
|
+
"uuid": "^11.1.0"
|
|
94
95
|
},
|
|
95
96
|
"devDependencies": {
|
|
96
97
|
"@opentelemetry/sdk-trace-base": "^2.0.0",
|
|
@@ -117,7 +118,7 @@
|
|
|
117
118
|
"gapic-tools": "^1.0.1",
|
|
118
119
|
"gts": "^6.0.2",
|
|
119
120
|
"jsdoc": "^4.0.4",
|
|
120
|
-
"jsdoc-fresh": "^
|
|
121
|
+
"jsdoc-fresh": "^4.0.0",
|
|
121
122
|
"jsdoc-region-tag": "^3.0.0",
|
|
122
123
|
"linkinator": "^6.1.2",
|
|
123
124
|
"lodash.random": "^3.2.0",
|
|
@@ -133,7 +134,6 @@
|
|
|
133
134
|
"time-span": "4.0.0",
|
|
134
135
|
"tmp": "^0.2.3",
|
|
135
136
|
"typescript": "^5.8.2",
|
|
136
|
-
"uuid": "^11.1.0",
|
|
137
137
|
"yargs": "^17.7.2"
|
|
138
138
|
}
|
|
139
139
|
}
|