@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.
@@ -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 (uuid.validate(value)) {
910
- return { type: 'unspecified' };
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' };
@@ -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) {
@@ -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
- const typeObject = codec_1.codec.createTypeObject(type);
1092
- if ((type.child &&
1093
- typeObject.code === 'ARRAY' &&
1094
- typeObject.arrayElementType?.code !== 'TYPE_CODE_UNSPECIFIED') ||
1095
- (!type.child && typeObject.code !== 'TYPE_CODE_UNSPECIFIED')) {
1096
- paramTypes[param] = typeObject;
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
  }
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // Copyright 2025 Google LLC
2
+ // Copyright 2026 Google LLC
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
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.4.0",
4
+ "version": "8.5.0",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Google Inc.",
7
7
  "engines": {