Skip to content

Commit

Permalink
Revert "wip"
Browse files Browse the repository at this point in the history
This reverts commit 19c26f9.

Revert "protos update. and release changed from tag 'latest' to 'beta'"

This reverts commit 45a065c.

Revert "wip"

This reverts commit 21a4bea.
  • Loading branch information
Alexey Zorkaltsev committed Jan 27, 2024
1 parent 19c26f9 commit f7f486a
Show file tree
Hide file tree
Showing 22 changed files with 496 additions and 668 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ jobs:
with:
github-token: ${{ secrets.YDB_PLATFORM_BOT_TOKEN_REPO }}
npm-token: ${{ secrets.NODE_AUTH_TOKEN }}
npm-dist-tag: rc
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ All notable changes to this project will be documented in this file. See [standa
- decimal value is present as string instead of bigint
(it wasn't working for float values before)
- fix uuid and tz-date types conversion (it wasn't working before)
* signatures of most methods in TableSession are changed:
* signatures of most methods in Session are changed:
- executeQuery
Before: `(query, params, txControl, operationParams?, settings?, collectStats?)`
After: `(query, params, txControl, settings?)`
Expand Down Expand Up @@ -336,7 +336,7 @@ All notable changes to this project will be documented in this file. See [standa

* drop support of old environment variables ([963819a](https://www.github.com/ydb-platform/ydb-nodejs-sdk/commit/963819af9209a45749f5118077f1da4bdb390fa6))
* reorganize signature of SchemeClient's methods ([734d57a](https://www.github.com/ydb-platform/ydb-nodejs-sdk/commit/734d57a2dd7c655cf727b96df415212504339cf8))
* reorganize signatures of TableSession's methods ([431f149](https://www.github.com/ydb-platform/ydb-nodejs-sdk/commit/431f1491bf880f3ba9541d9455d8dd2f2b7849e6))
* reorganize signatures of Session's methods ([431f149](https://www.github.com/ydb-platform/ydb-nodejs-sdk/commit/431f1491bf880f3ba9541d9455d8dd2f2b7849e6))
* use identity names conversion in TypedData ([275598a](https://www.github.com/ydb-platform/ydb-nodejs-sdk/commit/275598aa444e1e977386a3dadd02bbc9ba01f38e))

### [2.9.2](https://www.github.com/ydb-platform/ydb-nodejs-sdk/compare/v2.9.1...v2.9.2) (2022-02-09)
Expand Down Expand Up @@ -431,7 +431,7 @@ All notable changes to this project will be documented in this file. See [standa
* and many other changes in protobufs.

### 1.10.0
* Add `alterTable` method to TableSession class
* Add `alterTable` method to Session class
* Put compiled protobufs to a separate 'ydb-sdk' namespace

### 1.9.0
Expand Down
14 changes: 7 additions & 7 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
Expand Up @@ -42,7 +42,7 @@
"luxon": "^3.2.1",
"reflect-metadata": "^0.1.13",
"uuid": "^8.3.2",
"ydb-sdk-proto": "^1.2.1"
"ydb-sdk-proto": "^1.1.0"
},
"devDependencies": {
"@commitlint/cli": "^17.6.1",
Expand Down
1 change: 0 additions & 1 deletion query/index.ts

This file was deleted.

68 changes: 0 additions & 68 deletions query/query-client.ts

This file was deleted.

21 changes: 0 additions & 21 deletions query/query-session.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/__tests__/alter-table.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {
AlterTableDescription,
AlterTableSettings,
Column,
OperationParams,
TableDescription,
TableIndex,
} from '../table/table-session';
} from '../table';
import { Types } from '../types';
import {OperationParams} from "../table/session";

const getTableName = () => `table_alter_${Math.trunc(1000 * Math.random())}`;

Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/bulk-upsert.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {
Row,
TABLE
} from '../test-utils';
import {TableSession} from '../table/table-session';
import {Session} from '../table';
import {Ydb} from 'ydb-sdk-proto';

async function readTable(session: TableSession): Promise<Row[]> {
async function readTable(session: Session): Promise<Row[]> {
const rows: Row[] = [];

await session.streamReadTable(TABLE, (result) => {
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/bytestring-identity.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Driver from '../driver';
import {destroyDriver, initDriver, TABLE} from '../test-utils';
import {Column, TableSession, TableDescription} from '../table/table-session';
import {Column, Session, TableDescription} from '../table';
import {declareType, TypedData, Types} from '../types';
import {withRetries} from '../retries';

async function createTable(session: TableSession) {
async function createTable(session: Session) {
await session.dropTable(TABLE);
await session.createTable(
TABLE,
Expand Down Expand Up @@ -46,7 +46,7 @@ class Row extends TypedData {
}
}

export async function fillTableWithData(session: TableSession, rows: Row[]) {
export async function fillTableWithData(session: Session, rows: Row[]) {
const query = `
DECLARE $data AS List<Struct<id: Uint64, field1: Text, field2: String, field3: Yson>>;
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/create-table.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Driver from '../driver';
import {destroyDriver, initDriver} from '../test-utils';
import {Column, DescribeTableSettings, TableDescription} from '../table/table-session';
import {Column, DescribeTableSettings, TableDescription} from '../table';
import {TypedValues, Types} from '../types';
import Long from 'long';
import {Ydb} from 'ydb-sdk-proto';
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/read-table.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {
Row,
TABLE
} from '../test-utils';
import {ReadTableSettings, TableSession} from '../table/table-session';
import {ReadTableSettings, Session} from '../table';
import {TypedValues, TypedData} from '../types';

async function readTable(session: TableSession, settings: ReadTableSettings): Promise<TypedData[]> {
async function readTable(session: Session, settings: ReadTableSettings): Promise<TypedData[]> {
const rows: TypedData[] = [];

await session.streamReadTable(TABLE, (result) => {
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/scan-query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {
initDriver,
Row,
} from '../test-utils';
import {TableSession} from '../table/table-session';
import {Session} from '../table';
import {TypedData} from '../types';

async function executeScanQuery(session: TableSession): Promise<TypedData[]> {
async function executeScanQuery(session: Session): Promise<TypedData[]> {
const query = `SELECT * FROM ${TABLE};`;

const rows: TypedData[] = [];
Expand Down
18 changes: 4 additions & 14 deletions src/driver.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import DiscoveryService from './discovery';
import {SchemeClient} from './scheme';
// import {QueryClient} from './query/query-client';
import {TableClient} from './table';
import SchemeService from './scheme';
import {ENDPOINT_DISCOVERY_PERIOD} from './constants';
import {IAuthService} from './credentials';
import {TimeoutExpired} from './errors';
import {getLogger, Logger} from './logging';
import SchemeClient from './scheme';
import {ClientOptions} from './utils';
import {parseConnectionString} from './parse-connection-string';
import {makeSslCredentials, ISslCredentials} from './ssl-credentials';
import {TableClient} from "./table/table-client";

export interface IPoolSettings {
minLimit?: number;
Expand Down Expand Up @@ -38,8 +38,7 @@ export default class Driver {
private discoveryService: DiscoveryService;

public tableClient: TableClient;
public schemeClient: SchemeClient;
// public queryClient: QueryClient;
public schemeClient: SchemeService;

constructor(settings: IDriverSettings) {
this.logger = settings.logger || getLogger();
Expand Down Expand Up @@ -80,15 +79,6 @@ export default class Driver {
discoveryService: this.discoveryService,
logger: this.logger,
});
// this.queryClient = new QueryClient({
// database: this.database,
// authService: this.authService,
// sslCredentials: this.sslCredentials,
// poolSettings: this.poolSettings,
// clientOptions: this.clientOptions,
// discoveryService: this.discoveryService,
// logger: this.logger,
// });
this.schemeClient = new SchemeClient({
database: this.database,
authService: this.authService,
Expand Down
17 changes: 8 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ export {
StringFunction,
} from './types';
export {
TableSession,
SessionPool,
Session,
CreateTableSettings,
AlterTableSettings,
DropTableSettings,
BeginTransactionSettings,
CommitTransactionSettings,
RollbackTransactionSettings,
DescribeTableSettings,
PrepareQuerySettings,
ExecuteQuerySettings,
Expand All @@ -50,8 +54,9 @@ export {
CompactionPolicy,
ExecutionPolicy,
CachingPolicy,

} from './table/table-session';
OperationParams,
AUTO_TX,
} from './table';
export {
MakeDirectorySettings,
RemoveDirectorySettings,
Expand All @@ -73,9 +78,3 @@ export {
export {ISslCredentials} from './ssl-credentials';
export {withRetries, RetryParameters} from './retries';
export {YdbError, StatusCode} from './errors';
export {SessionPool} from "./table/session-pool";
export {RollbackTransactionSettings} from "./table/session";
export {CommitTransactionSettings} from "./table/session";
export {BeginTransactionSettings} from "./table/session";
export {OperationParams} from "./table/session";
export {AUTO_TX} from "./table/session";
4 changes: 2 additions & 2 deletions src/scheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {Logger} from './logging';
import DiscoveryService, {Endpoint} from './discovery';
import {retryable} from "./retries";
import {ISslCredentials} from './ssl-credentials';
import {OperationParamsSettings} from './table';

import SchemeServiceAPI = Ydb.Scheme.V1.SchemeService;
import ListDirectoryResult = Ydb.Scheme.ListDirectoryResult;
Expand All @@ -21,7 +22,6 @@ import IMakeDirectoryRequest = Ydb.Scheme.IMakeDirectoryRequest;
import IPermissions = Ydb.Scheme.IPermissions;
import {util} from "protobufjs";
import EventEmitter = util.EventEmitter;
import {OperationParamsSettings} from "./table/session";


function preparePermissions(action?: IPermissions | null) {
Expand Down Expand Up @@ -70,7 +70,7 @@ interface ISchemeClientSettings {
logger: Logger;
}

export class SchemeClient extends EventEmitter {
export default class SchemeClient extends EventEmitter {
private schemeServices: Map<Endpoint, SchemeService>;

constructor(private settings: ISchemeClientSettings) {
Expand Down
Loading

0 comments on commit f7f486a

Please sign in to comment.