import { Driver } from "../Driver"; import { DriverOptions } from "../DriverOptions"; import { DatabaseConnection } from "../DatabaseConnection"; import { Logger } from "../../logger/Logger"; import { QueryRunner } from "../../query-runner/QueryRunner"; import { ObjectLiteral } from "../../common/ObjectLiteral"; import { ColumnMetadata } from "../../metadata/ColumnMetadata"; import { NamingStrategyInterface } from "../../naming-strategy/NamingStrategyInterface"; /** * Organizes communication with sqljs in the browser. */ export declare class SqljsWorkerDriver implements Driver { /** * sql.js library. */ /** * worker.sql.js library. */ protected workerSqljs: any; /** * Naming strategy used in the connection where this driver is used. */ namingStrategy: NamingStrategyInterface; /** * Driver connection options. */ readonly options: DriverOptions; /** * Connection to database. */ protected databaseConnection: DatabaseConnection | undefined; /** * Logger used to log queries and errors. */ protected logger: Logger; constructor(options: DriverOptions, logger: Logger, workerSqljs?: any); /** * Performs connection to the database. * Based on pooling options, it can either create connection immediately, * either create a pool and create connection when needed. */ connect(): Promise; private setConnection(buffer?); /** * Closes connection with the database. */ disconnect(): Promise; commitStorage(): Promise; toBuffer(buf: any): any[]; /** * Creates a query runner used for common queries. */ createQueryRunner(): Promise; /** * Access to the native implementation of the database. */ nativeInterface(): { connection: any; }; /** * Replaces parameters in the given sql with special escaping character * and an array of parameter names to be passed to a query. */ escapeQueryWithParameters(sql: string, parameters: ObjectLiteral): [string, any[]]; /** * Escapes a column name. */ escapeColumnName(columnName: string): string; /** * Escapes an alias. */ escapeAliasName(aliasName: string): string; /** * Escapes a table name. */ escapeTableName(tableName: string): string; /** * Prepares given value to a value to be persisted, based on its column type and metadata. */ preparePersistentValue(value: any, columnMetadata: ColumnMetadata): any; /** * Prepares given value to a value to be persisted, based on its column type or metadata. */ prepareHydratedValue(value: any, columnMetadata: ColumnMetadata): any; /** * Retrieves a new database connection. * If pooling is enabled then connection from the pool will be retrieved. * Otherwise active connection will be returned. */ protected retrieveDatabaseConnection(): Promise; /** * If driver dependency is not given explicitly, then try to load it via "require". */ protected loadDependencies(): void; }