import { WASQLiteVFS } from './vfs.js'; import { TemporaryStorageOption } from '../options.js'; import { RawQueryResult, SqliteValue } from '@powersync/common'; export interface RawWebResult extends Required { autocommit: boolean; } export interface RawResultSet { columnNames: string[]; rawRows: SqliteValue[][]; } /** * @internal */ export interface RawWaSqliteDatabaseOptions { filename: string; readonly: boolean; vfs: WASQLiteVFS; encryptionKey: string | undefined; temporaryStorage: TemporaryStorageOption; cacheSizeKb: number; /** * The amount of prepared statements to cache, or 0 to disable caching. */ preparedStatementsCache: number; } /** * A small wrapper around WA-sqlite to help with opening databases and running statements by preparing them internally. * * This is an internal class, and it must never be used directly. Wrappers are required to ensure raw connections aren't * used concurrently across tabs. */ export declare class RawSqliteConnection { readonly options: RawWaSqliteDatabaseOptions; private _sqliteAPI; private sqlite3_stmt_isexplain; /** * The `sqlite3*` connection pointer. */ private db; private statementCache; constructor(options: RawWaSqliteDatabaseOptions); get isOpen(): boolean; init(): Promise; initWithModule(module: any, vfs: any): Promise; private openSQLiteAPI; requireSqlite(): SQLiteAPI; /** * Checks if the database connection is in autocommit mode. * @returns true if in autocommit mode, false if in a transaction */ isAutoCommit(): boolean; execute(sql: string, bindings?: any[]): Promise; executeBatch(sql: string, bindings: any[][]): Promise; private wrapQueryResults; /** * This executes a single statement using SQLite3 and returns the results as a {@link RawResultSet}. */ private executeSingleStatementRaw; executeRaw(sql: string, bindings?: any[]): Promise; private stepThroughStatement; close(): Promise; private cachedStatements; }