Skip to content

Commit

Permalink
Merge branch 'main' into topic
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Zorkaltsev authored Jul 23, 2024
2 parents 0e1de98 + 884eb06 commit 2f94e8e
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions examples/basic-example-v2-with-query-service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -221,6 +233,10 @@ async function fillTablesWithData(driver: Driver, _logger: Logger) {
'$episodesData': getEpisodesData()
},
text: `
DECLARE $seriesData AS List<Struct<series_id: Uint64, title: Utf8, release_date: Date, series_info: Utf8>>;
DECLARE $seasonsData AS List<Struct<series_id: Uint64, season_id: Uint64, title: Utf8, first_aired: Date, last_aired: Date>>;
DECLARE $episodesData AS List<Struct<series_id: Uint64, season_id: Uint64, episode_id: Uint64, title: Utf8, air_date: Date>>;
REPLACE
INTO
${SERIES_TABLE}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
11 changes: 9 additions & 2 deletions src/__tests__/e2e/query-service/method-execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ describe('Query.execute()', () => {

await session.execute({
text: `
DECLARE $table AS List<Struct<id: Uint64, title: Utf8, time: Datetime,>>;
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)]),
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 7 additions & 1 deletion src/__tests__/e2e/query-service/rows-conversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/e2e/table-service/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit 2f94e8e

Please sign in to comment.