Skip to content

Commit 07e5f3d

Browse files
authored
Merge branch 'main' into databaserole_sessionlabels
2 parents 100c54b + 987e727 commit 07e5f3d

File tree

7 files changed

+74
-17
lines changed

7 files changed

+74
-17
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44

55
[1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions
66

7+
## [8.5.0](https://github.com/googleapis/nodejs-spanner/compare/v8.4.0...v8.5.0) (2026-01-22)
8+
9+
10+
### Features
11+
12+
* Added OUTPUT_ONLY annotations to create_time and update_time in InternalRange to reflect existing service behavior ([#2505](https://github.com/googleapis/nodejs-spanner/issues/2505)) ([1058683](https://github.com/googleapis/nodejs-spanner/commit/105868339b1d2b7d7701a6b7591b85e3a1ca4098))
13+
14+
15+
### Bug Fixes
16+
17+
* UUID type backward compatibility ([#2509](https://github.com/googleapis/nodejs-spanner/issues/2509)) ([7abb33c](https://github.com/googleapis/nodejs-spanner/commit/7abb33ca523b612f171def64c1ceb0cb7d162e82))
18+
719
## [8.4.0](https://github.com/googleapis/nodejs-spanner/compare/v8.3.1...v8.4.0) (2026-01-09)
820

921

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@google-cloud/spanner",
33
"description": "Cloud Spanner Client Library for Node.js",
4-
"version": "8.4.0",
4+
"version": "8.5.0",
55
"license": "Apache-2.0",
66
"author": "Google Inc.",
77
"engines": {

samples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dependencies": {
1818
"@google-cloud/kms": "^5.0.0",
1919
"@google-cloud/precise-date": "^5.0.0",
20-
"@google-cloud/spanner": "^8.4.0",
20+
"@google-cloud/spanner": "^8.5.0",
2121
"protobufjs": "^7.0.0",
2222
"yargs": "^17.0.0"
2323
},

samples/system-test/spanner.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ describe('Autogenerated Admin Clients', () => {
15461546
it('should restore database from a backup', async function () {
15471547
// Restoring a backup can be a slow operation so the test may timeout and
15481548
// we'll have to retry.
1549-
this.retries(5);
1549+
this.retries(3);
15501550
// Delay the start of the test, if this is a retry.
15511551
await delay(this.test, async () => {
15521552
await cleanupDatabase(INSTANCE_ID, RESTORE_DATABASE_ID);
@@ -1569,7 +1569,7 @@ describe('Autogenerated Admin Clients', () => {
15691569
it('should restore database from a backup using an encryption key', async function () {
15701570
// Restoring a backup can be a slow operation so the test may timeout and
15711571
// we'll have to retry.
1572-
this.retries(5);
1572+
this.retries(3);
15731573
// Delay the start of the test, if this is a retry.
15741574
await delay(this.test, async () => {
15751575
await cleanupDatabase(INSTANCE_ID, ENCRYPTED_RESTORE_DATABASE_ID);
@@ -2433,7 +2433,8 @@ describe('Autogenerated Admin Clients', () => {
24332433
});
24342434
});
24352435

2436-
describe('encrypted database and backups with multiple KMS keys', () => {
2436+
// Skipping KMS test suite as tests are getting timed out frequently.
2437+
describe.skip('encrypted database and backups with multiple KMS keys', () => {
24372438
const MR_CMEK_DB = `test-mr-${CURRENT_TIME}-db`;
24382439
const MR_CMEK_BACKUP = `test-mr-${CURRENT_TIME}-backup`;
24392440
const MR_CMEK_COPIED = `test-mr-${CURRENT_TIME}-copied`;

src/codec.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ import * as uuid from 'uuid';
3838
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3939
export type Value = any;
4040

41+
let uuidUntypedFlagWarned = false;
42+
4143
export interface Field {
4244
name: string;
4345
value: Value;
@@ -1160,8 +1162,17 @@ function getType(value: Value): Type {
11601162
return {type: 'bool'};
11611163
}
11621164

1163-
if (uuid.validate(value)) {
1164-
return {type: 'unspecified'};
1165+
if (process.env['SPANNER_ENABLE_UUID_AS_UNTYPED'] === 'true') {
1166+
if (!uuidUntypedFlagWarned) {
1167+
process.emitWarning(
1168+
'SPANNER_ENABLE_UUID_AS_UNTYPED environment variable is deprecated and will be removed in a future release.',
1169+
'DeprecationWarning',
1170+
);
1171+
uuidUntypedFlagWarned = true;
1172+
}
1173+
if (uuid.validate(value)) {
1174+
return {type: 'unspecified'};
1175+
}
11651176
}
11661177

11671178
if (isString(value)) {

src/transaction.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,14 +1735,18 @@ export class Snapshot extends EventEmitter {
17351735
if (!isEmpty(typeMap)) {
17361736
Object.keys(typeMap).forEach(param => {
17371737
const type = typeMap[param];
1738-
const typeObject = codec.createTypeObject(type);
1739-
if (
1740-
(type.child &&
1741-
typeObject.code === 'ARRAY' &&
1742-
typeObject.arrayElementType?.code !== 'TYPE_CODE_UNSPECIFIED') ||
1743-
(!type.child && typeObject.code !== 'TYPE_CODE_UNSPECIFIED')
1744-
) {
1745-
paramTypes[param] = typeObject;
1738+
if (process.env['SPANNER_ENABLE_UUID_AS_UNTYPED'] === 'true') {
1739+
const typeObject = codec.createTypeObject(type);
1740+
if (
1741+
(type.child &&
1742+
typeObject.code === 'ARRAY' &&
1743+
typeObject.arrayElementType?.code !== 'TYPE_CODE_UNSPECIFIED') ||
1744+
(!type.child && typeObject.code !== 'TYPE_CODE_UNSPECIFIED')
1745+
) {
1746+
paramTypes[param] = typeObject;
1747+
}
1748+
} else {
1749+
paramTypes[param] = codec.createTypeObject(type);
17461750
}
17471751
});
17481752
}

test/codec.ts

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,12 +1778,41 @@ describe('codec', () => {
17781778
});
17791779
});
17801780

1781-
it('should determine if the uuid value is unspecified', () => {
1781+
it('should determine if the uuid value is string', () => {
17821782
assert.deepStrictEqual(codec.getType(uuid.v4()), {
1783-
type: 'unspecified',
1783+
type: 'string',
17841784
});
17851785
});
17861786

1787+
it('should determine if the uuid value is unspecified when SPANNER_ENABLE_UUID_AS_UNTYPED is true', () => {
1788+
const emitWarningStub = sandbox.stub(process, 'emitWarning');
1789+
try {
1790+
process.env['SPANNER_ENABLE_UUID_AS_UNTYPED'] = 'true';
1791+
assert.deepStrictEqual(codec.getType(uuid.v4()), {
1792+
type: 'unspecified',
1793+
});
1794+
assert.strictEqual(emitWarningStub.calledOnce, true);
1795+
assert.strictEqual(
1796+
emitWarningStub.firstCall.args[0],
1797+
'SPANNER_ENABLE_UUID_AS_UNTYPED environment variable is deprecated and will be removed in a future release.',
1798+
);
1799+
} finally {
1800+
delete process.env['SPANNER_ENABLE_UUID_AS_UNTYPED'];
1801+
emitWarningStub.restore();
1802+
}
1803+
});
1804+
1805+
it('should determine if the uuid value is string when SPANNER_ENABLE_UUID_AS_UNTYPED is false', () => {
1806+
try {
1807+
process.env['SPANNER_ENABLE_UUID_AS_UNTYPED'] = 'false';
1808+
assert.deepStrictEqual(codec.getType(uuid.v4()), {
1809+
type: 'string',
1810+
});
1811+
} finally {
1812+
delete process.env['SPANNER_ENABLE_UUID_AS_UNTYPED'];
1813+
}
1814+
});
1815+
17871816
it('should determine if the value is a float32', () => {
17881817
assert.deepStrictEqual(codec.getType(new codec.Float32(1.1)), {
17891818
type: 'float32',

0 commit comments

Comments
 (0)