UNPKG

@egi/smart-db

Version:

Unified Smart DB Access

32 lines (31 loc) 1.9 kB
import BetterSqlite3 from "better-sqlite3"; 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"; declare type VariableArgFunction = (...params: any[]) => any; export declare class SmartDbBetterSqlite3 extends SmartDb { protected db: BetterSqlite3.Database; constructor(connectorOrDb: string | BetterSqlite3.Database, options?: BetterSqlite3.Options); aggregate(name: string, options: BetterSqlite3.AggregateOptions): boolean; backup(destinationFile: string, options?: BetterSqlite3.BackupOptions): Promise<BetterSqlite3.BackupMetadata>; closeSync(): boolean; commitSync(): void; defaultSafeIntegers(toggleState?: boolean): boolean; execSync(script: string): boolean; existsSync<T extends AbstractModel<T, D>, D extends GenericModelData>(modelClass: string | (new () => T), type?: "view" | "table" | "index", indexTableName?: string): boolean; func(name: string, options: BetterSqlite3.RegistrationOptions, cb: VariableArgFunction): boolean; getDatabaseType(): string; getTableInfo(tableName: string): Promise<SmartDbTableInfo>; hasTransaction(): boolean; loadExtension(path: string): boolean; pragma(source: string, options?: BetterSqlite3.PragmaOptions): unknown; rollbackSync(): void; transaction<F extends VariableArgFunction>(fn: F): boolean; protected statementRun(buildData: SmartDbSqlBuildData, retry?: number): Promise<SmartDbRunResult>; protected statementRunSync(buildData: SmartDbSqlBuildData): SmartDbRunResult; protected statementGetSync(buildData: SmartDbSqlBuildData): any; protected statementGetAllSync(buildData: SmartDbSqlBuildData): any[]; get supportSyncCalls(): boolean; } export {};