From 847d692753ec3cefe3d624fb5fb142b226da49b0 Mon Sep 17 00:00:00 2001 From: Alexey Zorkaltsev Date: Wed, 3 Jul 2024 14:38:13 +0300 Subject: [PATCH 1/3] chore: test change --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5fff5cf3..be255a70 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ You can take a look at our Roadmap for the near future [here](ROADMAP.md). # How to use + ## Install package from NPM ```bash npm install ydb-sdk From 8920feec8ff45ca0210019d57a6b92cc5e2e9880 Mon Sep 17 00:00:00 2001 From: Alexey Zorkaltsev Date: Thu, 4 Jul 2024 15:37:24 +0300 Subject: [PATCH 2/3] fix: add DECLARE that is still required by YDB 24.1 --- .../basic-example-v2-with-query-service/index.ts | 16 ++++++++++++++++ .../e2e/query-service/method-execute.ts | 11 +++++++++-- .../e2e/query-service/rows-conversion.ts | 8 +++++++- src/__tests__/e2e/table-service/types.test.ts | 2 +- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/examples/basic-example-v2-with-query-service/index.ts b/examples/basic-example-v2-with-query-service/index.ts index 3c964961..70ab6fed 100644 --- a/examples/basic-example-v2-with-query-service/index.ts +++ b/examples/basic-example-v2-with-query-service/index.ts @@ -143,6 +143,10 @@ async function selectWithParameters(driver: Driver, data: ThreeIds[], logger: Lo '$episodeId': episode.getTypedValue('episodeId') }, text: ` + DECLARE $seriesId AS Uint64; + DECLARE $seasonId AS Uint64; + DECLARE $episodeId AS Uint64; + SELECT title, air_date FROM episodes @@ -173,6 +177,10 @@ async function explicitTcl(driver: Driver, ids: ThreeIds, logger: Logger) { '$episodeId': episode.getTypedValue('episodeId') }, text: ` + DECLARE $seriesId AS Uint64; + DECLARE $seasonId AS Uint64; + DECLARE $episodeId AS Uint64; + UPDATE episodes SET air_date = CurrentUtcDate() WHERE series_id = $seriesId @@ -200,6 +208,10 @@ async function transactionPerWholeDo(driver: Driver, ids: ThreeIds, logger: Logg '$episodeId': episode.getTypedValue('episodeId') }, text: ` + DECLARE $seriesId AS Uint64; + DECLARE $seasonId AS Uint64; + DECLARE $episodeId AS Uint64; + UPDATE episodes SET air_date = CurrentUtcDate() WHERE series_id = $seriesId @@ -221,6 +233,10 @@ async function fillTablesWithData(driver: Driver, _logger: Logger) { '$episodesData': getEpisodesData() }, text: ` + DECLARE $seriesData AS List>; + DECLARE $seasonsData AS List>; + DECLARE $episodesData AS List>; + REPLACE INTO ${SERIES_TABLE} diff --git a/src/__tests__/e2e/query-service/method-execute.ts b/src/__tests__/e2e/query-service/method-execute.ts index 81a8fad4..b541e5a4 100644 --- a/src/__tests__/e2e/query-service/method-execute.ts +++ b/src/__tests__/e2e/query-service/method-execute.ts @@ -156,8 +156,9 @@ describe('Query.execute()', () => { await session.execute({ text: ` + DECLARE $table AS List>; UPSERT INTO ${TABLE_NAME} (id, title, time) - SELECT id, title, time FROM AS_TABLE($table) + SELECT id, title, time FROM AS_TABLE($table); `, parameters: { '$table': Row.asTypedCollection([...dataGenerator(generatedRowsCount)]), @@ -196,9 +197,15 @@ describe('Query.execute()', () => { '$title1': TypedValues.text('Some title1'), '$id2': TypedValues.uint64(2), '$title2': TypedValues.text('Some title2'), - '$timestamp': TypedValues.timestamp(new Date()), + '$timestamp': TypedValues.datetime(new Date()), }, text: ` + DECLARE $id1 AS Uint64; + DECLARE $title1 AS Utf8; + DECLARE $id2 AS Uint64; + DECLARE $title2 AS Utf8; + DECLARE $timestamp AS Datetime; + INSERT INTO ${TABLE_NAME} (id, title, time) VALUES ($id1, $title1, $timestamp); INSERT INTO ${TABLE_NAME} (id, title, time) diff --git a/src/__tests__/e2e/query-service/rows-conversion.ts b/src/__tests__/e2e/query-service/rows-conversion.ts index 148d05f1..5310d414 100644 --- a/src/__tests__/e2e/query-service/rows-conversion.ts +++ b/src/__tests__/e2e/query-service/rows-conversion.ts @@ -115,9 +115,15 @@ describe('Rows conversion', () => { '$title1': TypedValues.text('Some title1'), '$id2': TypedValues.uint64(2), '$title2': TypedValues.text('Some title2'), - '$timestamp': TypedValues.timestamp(new Date()), + '$timestamp': TypedValues.datetime(new Date()), }, text: ` + DECLARE $id1 AS Uint64; + DECLARE $title1 AS Utf8; + DECLARE $id2 AS Uint64; + DECLARE $title2 AS Utf8; + DECLARE $timestamp AS Datetime; + INSERT INTO ${TABLE_NAME} (id, row_title, time) VALUES ($id1, $title1, $timestamp); INSERT INTO ${TABLE_NAME} (id, row_title, time) diff --git a/src/__tests__/e2e/table-service/types.test.ts b/src/__tests__/e2e/table-service/types.test.ts index 2c4065ae..0413904f 100644 --- a/src/__tests__/e2e/table-service/types.test.ts +++ b/src/__tests__/e2e/table-service/types.test.ts @@ -16,7 +16,7 @@ describe('Types', () => { describe('Convert from native to YDB value', () => { describe('Primitive values', () => { - it.only('Numeric values', () => { + it('Numeric values', () => { expect(TypedValues.bool(true)).toEqual({ type: {typeId: Ydb.Type.PrimitiveTypeId.BOOL}, value: {boolValue: true}, From cf2378d1adcb8840c81041903af3c52472c639b7 Mon Sep 17 00:00:00 2001 From: ydb-platform-bot <95354183+ydb-platform-bot@users.noreply.github.com> Date: Thu, 4 Jul 2024 15:54:06 +0300 Subject: [PATCH 3/3] chore(main): release 5.3.3 --- CHANGELOG.md | 8 ++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4df6305..4453dac1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [5.3.3](https://github.com/ydb-platform/ydb-nodejs-sdk/compare/v5.3.2...v5.3.3) (2024-07-04) + + +### Bug Fixes + +* add DECLARE that is still required by YDB 24.1 ([8920fee](https://github.com/ydb-platform/ydb-nodejs-sdk/commit/8920feec8ff45ca0210019d57a6b92cc5e2e9880)) +* query service switched to new retryer ([43ce40b](https://github.com/ydb-platform/ydb-nodejs-sdk/commit/43ce40b4b354e585f750ef9ba14331013352e7f9)) + ## [5.3.2](https://github.com/ydb-platform/ydb-nodejs-sdk/compare/v5.3.1...v5.3.2) (2024-03-28) diff --git a/package-lock.json b/package-lock.json index 561fb732..b1f261e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ydb-sdk", - "version": "5.3.2", + "version": "5.3.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ydb-sdk", - "version": "5.3.2", + "version": "5.3.3", "license": "Apache", "dependencies": { "@grpc/grpc-js": "^1.5.3", diff --git a/package.json b/package.json index 91270a59..8ab424cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ydb-sdk", - "version": "5.3.2", + "version": "5.3.3", "description": "Node.js bindings for working with YDB API over gRPC", "main": "build/cjs/src/index.js", "module": "build/esm/src/index.js",