@n8n/typeorm
Version:
Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.
34 lines (33 loc) • 1.26 kB
TypeScript
import { DbLease, DbLeaseHolder, DbLeaseOwner, SqliteConnectionPool } from "./SqlitePooledTypes";
import { SqliteLibrary } from "./SqliteLibrary";
/**
* A single write connection to the database.
*/
export declare class SqliteWriteConnection implements SqliteConnectionPool, DbLeaseOwner {
private readonly sqliteLibray;
private readonly options;
private writeConnectionPromise;
/**
* Should the connection be re-created after it has been released
*/
private isConnectionValid;
private isReleased;
/**
* Mutex to control access to the write connection.
*/
private readonly writeConnectionMutex;
private dbLease;
constructor(sqliteLibray: SqliteLibrary, options: {
acquireTimeout: number;
destroyTimeout: number;
});
connect(): Promise<void>;
close(): Promise<void>;
runExclusive<T>(dbLeaseHolder: DbLeaseHolder, callback: (dbLease: DbLease) => Promise<T>): Promise<T>;
leaseConnection(dbLeaseHolder: DbLeaseHolder): Promise<DbLease>;
invalidateConnection(leasedDbConnection: DbLease): void;
releaseConnection(leasedDbConnection: DbLease): Promise<void>;
private createAndGetConnection;
private createConnection;
private assertNotReleased;
}