@google-cloud/spanner 8.4.0 → 8.5.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/src/codec.js
CHANGED
|
@@ -23,6 +23,7 @@ const big_js_1 = require("big.js");
|
|
|
23
23
|
const protos_1 = require("../protos/protos");
|
|
24
24
|
const google_gax_1 = require("google-gax");
|
|
25
25
|
const uuid = require("uuid");
|
|
26
|
+
let uuidUntypedFlagWarned = false;
|
|
26
27
|
/**
|
|
27
28
|
* Date-like object used to represent Cloud Spanner Dates. DATE types represent
|
|
28
29
|
* a logical calendar date, independent of time zone. DATE values do not
|
|
@@ -906,8 +907,14 @@ function getType(value) {
|
|
|
906
907
|
if ((0, helper_1.isBoolean)(value)) {
|
|
907
908
|
return { type: 'bool' };
|
|
908
909
|
}
|
|
909
|
-
if (
|
|
910
|
-
|
|
910
|
+
if (process.env['SPANNER_ENABLE_UUID_AS_UNTYPED'] === 'true') {
|
|
911
|
+
if (!uuidUntypedFlagWarned) {
|
|
912
|
+
process.emitWarning('SPANNER_ENABLE_UUID_AS_UNTYPED environment variable is deprecated and will be removed in a future release.', 'DeprecationWarning');
|
|
913
|
+
uuidUntypedFlagWarned = true;
|
|
914
|
+
}
|
|
915
|
+
if (uuid.validate(value)) {
|
|
916
|
+
return { type: 'unspecified' };
|
|
917
|
+
}
|
|
911
918
|
}
|
|
912
919
|
if ((0, helper_1.isString)(value)) {
|
|
913
920
|
return { type: 'string' };
|
package/build/src/instrument.js
CHANGED
|
@@ -87,6 +87,7 @@ function startTrace(spanNameSuffix, config, cb) {
|
|
|
87
87
|
span.setAttribute('db.sql.table', config.tableName);
|
|
88
88
|
}
|
|
89
89
|
if (config.dbName) {
|
|
90
|
+
span.setAttribute('gcp.resource.name', `//spanner.googleapis.com/${config.dbName}`);
|
|
90
91
|
span.setAttribute('db.name', config.dbName);
|
|
91
92
|
}
|
|
92
93
|
if (config.requestTag) {
|
package/build/src/transaction.js
CHANGED
|
@@ -1088,12 +1088,17 @@ class Snapshot extends events_1.EventEmitter {
|
|
|
1088
1088
|
if (!(0, helper_1.isEmpty)(typeMap)) {
|
|
1089
1089
|
Object.keys(typeMap).forEach(param => {
|
|
1090
1090
|
const type = typeMap[param];
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1091
|
+
if (process.env['SPANNER_ENABLE_UUID_AS_UNTYPED'] === 'true') {
|
|
1092
|
+
const typeObject = codec_1.codec.createTypeObject(type);
|
|
1093
|
+
if ((type.child &&
|
|
1094
|
+
typeObject.code === 'ARRAY' &&
|
|
1095
|
+
typeObject.arrayElementType?.code !== 'TYPE_CODE_UNSPECIFIED') ||
|
|
1096
|
+
(!type.child && typeObject.code !== 'TYPE_CODE_UNSPECIFIED')) {
|
|
1097
|
+
paramTypes[param] = typeObject;
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
else {
|
|
1101
|
+
paramTypes[param] = codec_1.codec.createTypeObject(type);
|
|
1097
1102
|
}
|
|
1098
1103
|
});
|
|
1099
1104
|
}
|