An abstract interface for a SQLite database.

Roughly based on better-sqlite3's Database class, (which can be used as-is), but only with the methods that are used by mtcute.

interface ISqliteDatabase {
    close: () => void;
    exec: (sql: string) => void;
    prepare: <BindParameters extends unknown[]>(
        sql: string,
    ) => ISqliteStatement<BindParameters>;
    transaction: <F extends (...args: any[]) => any>(fn: F) => F;
}

Properties

close: () => void
exec: (sql: string) => void
prepare: <BindParameters extends unknown[]>(
    sql: string,
) => ISqliteStatement<BindParameters>
transaction: <F extends (...args: any[]) => any>(fn: F) => F