diff --git a/doc/user_guide/user_guide.md b/doc/user_guide/user_guide.md index a71f290..3927996 100644 --- a/doc/user_guide/user_guide.md +++ b/doc/user_guide/user_guide.md @@ -11,10 +11,10 @@ npm install -S @exasol/exasol-driver-ts ws @types/ws Connecting to the database: ```js -import { ExasolDriver,ExaWebsocket } from '@exasol/exasol-driver-ts'; +import { ExasolClient,ExaWebsocket } from '@exasol/exasol-driver-ts'; import { WebSocket } from 'ws'; -const driver = new ExasolDriver((url) => { +const driver = new ExasolClient((url) => { return new WebSocket(url) as ExaWebsocket; }, { host: "localhost", @@ -43,9 +43,9 @@ npm install -S @exasol/exasol-driver-ts Connecting to the database: ```js -import { ExasolDriver,ExaWebsocket } from '@exasol/exasol-driver-ts'; +import { ExasolClient,ExaWebsocket } from '@exasol/exasol-driver-ts'; -const driver = new ExasolDriver((url) => { +const driver = new ExasolClient((url) => { return new WebSocket(url) as ExaWebsocket; }, { host: "localhost", diff --git a/integration-test/testcases/basic.spec.ts b/integration-test/testcases/basic.spec.ts index 17c5671..0275eb0 100644 --- a/integration-test/testcases/basic.spec.ts +++ b/integration-test/testcases/basic.spec.ts @@ -1,11 +1,11 @@ import { GenericContainer, StartedTestContainer, Wait } from 'testcontainers'; -import { ExasolDriver, websocketFactory } from '../../src/lib/sql-client'; +import { ExasolClient, websocketFactory } from '../../src/lib/sql-client'; import { RandomUuid } from 'testcontainers/dist/uuid'; export const basicTests = (name: string, factory: websocketFactory) => describe(name, () => { const randomId = new RandomUuid(); - let tmpDriver: ExasolDriver | undefined; + let tmpDriver: ExasolClient | undefined; let container: StartedTestContainer; jest.setTimeout(7000000); let schemaName = ''; @@ -102,7 +102,7 @@ export const basicTests = (name: string, factory: websocketFactory) => }); const openConnection = async (factory: websocketFactory, container: StartedTestContainer) => { - const driver = new ExasolDriver(factory, { + const driver = new ExasolClient(factory, { host: container.getHost(), port: container.getMappedPort(8563), user: 'sys', diff --git a/src/lib/errors/errors.ts b/src/lib/errors/errors.ts index 938bf31..f19861c 100644 --- a/src/lib/errors/errors.ts +++ b/src/lib/errors/errors.ts @@ -6,7 +6,7 @@ export const ErrMalformedData = new ExaErrorBuilder('E-EDJS-3').message('Malform export const ErrInvalidValuesCount = new ExaErrorBuilder('E-EDJS-4').message('Invalid value count for prepared status.').error(); export const ErrLoggerNil = new ExaErrorBuilder('E-EDJS-5') .message('Logger is undefined or null.') - .mitigation('Set logger in ExasolDriver constructor.') + .mitigation('Set logger in ExasolClient constructor.') .error(); export const ErrInvalidCredentials = new ExaErrorBuilder('E-EDJS-6').message('Invalid credentials.').error(); export const ErrJobAlreadyRunning = new ExaErrorBuilder('E-EDJS-7').message('Another query is already running.').error(); diff --git a/src/lib/sql-client.interface.ts b/src/lib/sql-client.interface.ts index fce1aea..f540b2f 100644 --- a/src/lib/sql-client.interface.ts +++ b/src/lib/sql-client.interface.ts @@ -10,7 +10,7 @@ export type Cancelable = () => void; export type CetCancelFunction = (cancel?: Cancelable) => void; -export interface IExasolDriver { +export interface IExasolClient { /** * Connect to database * @@ -42,7 +42,7 @@ export interface IExasolDriver { sqlStatement: string, attributes?: Partial, getCancel?: CetCancelFunction, - responseType?: 'default' + responseType?: 'default', ): Promise; /** @@ -58,7 +58,7 @@ export interface IExasolDriver { sqlStatement: string, attributes?: Partial, getCancel?: CetCancelFunction, - responseType?: 'raw' + responseType?: 'raw', ): Promise>; /** @@ -86,7 +86,7 @@ export interface IExasolDriver { sqlStatement: string, attributes?: Partial, getCancel?: CetCancelFunction, - responseType?: 'raw' + responseType?: 'raw', ): Promise>; /** @@ -101,7 +101,7 @@ export interface IExasolDriver { executeBatch( sqlStatements: string[], attributes?: Partial, - getCancel?: CetCancelFunction + getCancel?: CetCancelFunction, ): Promise>; /** * Prepare statement diff --git a/src/lib/sql-client.ts b/src/lib/sql-client.ts index 78c630a..660aaed 100644 --- a/src/lib/sql-client.ts +++ b/src/lib/sql-client.ts @@ -3,7 +3,7 @@ import * as forge from 'node-forge'; import { getURIScheme } from './utils'; import { CreatePreparedStatementResponse, PublicKeyResponse, SQLQueriesResponse, SQLResponse } from './types'; import { Statement } from './statement'; -import { CetCancelFunction, IExasolDriver as IExasolClient, IStatement } from './sql-client.interface'; +import { CetCancelFunction, IExasolClient as IExasolClient, IStatement } from './sql-client.interface'; //import { ConnectionPool } from './pool/pool'; import { ILogger, Logger, LogLevel } from './logger/logger'; import { fetchData } from './fetch';