import IDBSQLSession, { ExecuteStatementOptions, TypeInfoRequest, CatalogsRequest, SchemasRequest, TablesRequest, TableTypesRequest, ColumnsRequest, FunctionsRequest, PrimaryKeysRequest, CrossReferenceRequest } from './contracts/IDBSQLSession'; import IOperation from './contracts/IOperation'; import Status from './dto/Status'; import InfoValue from './dto/InfoValue'; import IClientContext from './contracts/IClientContext'; import ISessionBackend from './contracts/ISessionBackend'; import { numberToInt64 as numberToInt64Impl } from './thrift-backend/ThriftSessionBackend'; /** * Convert a JS number to a Thrift-wire `node-int64`. * * @deprecated Thrift-only utility re-exported for back-compat with existing * external consumers. Backends other than Thrift do not use `node-int64`; * new code should not import this from `DBSQLSession`. It will be removed * when the public API stops exposing Thrift wire types. */ export declare const numberToInt64: typeof numberToInt64Impl; interface DBSQLSessionConstructorOptions { backend: ISessionBackend; context: IClientContext; } export default class DBSQLSession implements IDBSQLSession { private readonly context; private readonly backend; private isOpen; onClose?: () => void; private operations; constructor(options: DBSQLSessionConstructorOptions); get id(): string; /** * Fetches info * @public * @param infoType - One of the values TCLIService_types.TGetInfoType * @returns Value corresponding to info type requested * @example * const response = await session.getInfo(thrift.TCLIService_types.TGetInfoType.CLI_DBMS_VER); */ getInfo(infoType: number): Promise; /** * Executes statement * @public * @param statement - SQL statement to be executed * @param options - maxRows field is used to specify Direct Results * @returns DBSQLOperation * @example * const operation = await session.executeStatement(query); */ executeStatement(statement: string, options?: ExecuteStatementOptions): Promise; private handleStagingOperation; private handleStagingGet; private handleStagingRemove; private handleStagingPut; /** * Information about supported data types * @public * @param request * @returns DBSQLOperation */ getTypeInfo(request?: TypeInfoRequest): Promise; /** * Get list of catalogs * @public * @param request * @returns DBSQLOperation */ getCatalogs(request?: CatalogsRequest): Promise; /** * Get list of schemas * @public * @param request * @returns DBSQLOperation */ getSchemas(request?: SchemasRequest): Promise; /** * Get list of tables * @public * @param request * @returns DBSQLOperation */ getTables(request?: TablesRequest): Promise; /** * Get list of supported table types * @public * @param request * @returns DBSQLOperation */ getTableTypes(request?: TableTypesRequest): Promise; /** * Get full information about columns of the table * @public * @param request * @returns DBSQLOperation */ getColumns(request?: ColumnsRequest): Promise; /** * Get information about function * @public * @param request * @returns DBSQLOperation */ getFunctions(request: FunctionsRequest): Promise; getPrimaryKeys(request: PrimaryKeysRequest): Promise; /** * Request information about foreign keys between two tables * @public * @param request * @returns DBSQLOperation */ getCrossReference(request: CrossReferenceRequest): Promise; /** * Closes the session * @public * @returns Operation status */ close(): Promise; private wrapOperation; /** * Bracket a backend call with `failIfClosed()` on both sides. The pre-call * check rejects work against an already-closed session; the post-call check * rejects results that came back after a concurrent close (server-side * close doesn't error out the in-flight RPC). Centralizing the pattern * keeps the 10+ delegation methods readable and makes the contract * impossible to forget. */ private runBackend; private failIfClosed; } export {};