import IOperationBackend from './IOperationBackend'; import { ExecuteStatementOptions, TypeInfoRequest, CatalogsRequest, SchemasRequest, TablesRequest, TableTypesRequest, ColumnsRequest, FunctionsRequest, PrimaryKeysRequest, CrossReferenceRequest } from './IDBSQLSession'; import Status from '../dto/Status'; import InfoValue from '../dto/InfoValue'; /** * What a `DBSQLSession` needs from its backend. Returned by * `IBackend.openSession()`. Lifecycle tied to a single `DBSQLSession`. */ export default interface ISessionBackend { /** Session identifier. */ readonly id: string; /** Returns general information about the data source. */ getInfo(infoType: number): Promise; /** Executes DDL/DML statements. */ executeStatement(statement: string, options: ExecuteStatementOptions): Promise; /** Information about supported data types. */ getTypeInfo(request: TypeInfoRequest): Promise; /** List of catalogs. */ getCatalogs(request: CatalogsRequest): Promise; /** List of schemas. */ getSchemas(request: SchemasRequest): Promise; /** List of tables. */ getTables(request: TablesRequest): Promise; /** List of supported table types. */ getTableTypes(request: TableTypesRequest): Promise; /** Full column information for a table. */ getColumns(request: ColumnsRequest): Promise; /** Information about a function. */ getFunctions(request: FunctionsRequest): Promise; /** Primary keys of a table. */ getPrimaryKeys(request: PrimaryKeysRequest): Promise; /** Foreign-key relationships between two tables. */ getCrossReference(request: CrossReferenceRequest): Promise; /** Close the session. Idempotent. */ close(): Promise; }