@metamask/kernel-store
Version:
Ocap Kernel storage abstractions and implementations
28 lines • 1.14 kB
text/typescript
import type { Database as SqliteDatabase } from "@sqlite.org/sqlite-wasm";
import type { KernelDatabase } from "../types.mjs";
export type Database = SqliteDatabase & {
_inTx: boolean;
_spStack: string[];
};
/**
* Ensure that SQLite is initialized.
*
* @param dbFilename - The filename of the database to use.
* @returns The SQLite database object.
*/
export declare function initDB(dbFilename: string): Promise<Database>;
/**
* Makes a {@link KernelDatabase} for low-level persistent storage.
*
* @param options - The options for the database.
* @param options.dbFilename - The filename of the database to use. Defaults to {@link DEFAULT_DB_FILENAME}.
* @param options.label - A logger prefix label. Defaults to '[sqlite]'.
* @param options.verbose - If true, generate logger output; if false, be quiet.
* @returns A key/value store to base higher level stores on.
*/
export declare function makeSQLKernelDatabase({ dbFilename, label, verbose, }: {
dbFilename?: string | undefined;
label?: string | undefined;
verbose?: boolean | undefined;
}): Promise<KernelDatabase>;
//# sourceMappingURL=wasm.d.mts.map