@egi/smart-db
Version:
Unified Smart DB Access
21 lines (20 loc) • 1.17 kB
TypeScript
import Mysql, { Connection, ConnectionConfig } from "mysql";
import { AbstractModel } from "../models/abstract-model";
import { SmartDb } from "../smart-db";
import { GenericModelData, SmartDbRunResult, SmartDbTableInfo } from "../smart-db-interfaces";
import { SmartDbSqlBuildData } from "../smart-db-sql-build-data";
export declare class SmartDbMysql2 extends SmartDb {
protected db: Mysql.Connection;
constructor(connectorOrDb: string | ConnectionConfig | Connection);
close(): Promise<boolean>;
commit(): Promise<void>;
exec(script: string): Promise<void>;
exists<T extends AbstractModel<T, D>, D extends GenericModelData>(modelClass: string | (new () => T), type?: "view" | "table" | "index", indexTableName?: string): Promise<boolean>;
getDatabaseType(): string;
getDbQuote(): string;
getTableInfo(table: string): Promise<SmartDbTableInfo>;
rollback(): Promise<void>;
protected statementRun(buildData: SmartDbSqlBuildData): Promise<SmartDbRunResult>;
protected statementGet<T extends object>(buildData: SmartDbSqlBuildData): Promise<T>;
protected statementGetAll<T>(buildData: SmartDbSqlBuildData): Promise<T[]>;
}