sqlocal
Version:
SQLocal makes it easy to run SQLite3 in the browser, backed by the origin private file system.
34 lines (33 loc) • 1.95 kB
TypeScript
import type { ProcessorConfig, UserFunction, QueryKey, ConnectReason, SQLocalDriver } from './types.js';
import type { BatchMessage, ConfigMessage, DeleteMessage, DestroyMessage, ExportMessage, FunctionMessage, GetInfoMessage, ImportMessage, InputMessage, OutputMessage, QueryMessage, TransactionMessage, WorkerProxy } from './messages.js';
export declare class SQLocalProcessor {
protected driver: SQLocalDriver;
protected config: ProcessorConfig;
protected userFunctions: Map<string, UserFunction>;
protected initMutex: {
lock: () => Promise<void>;
unlock: () => Promise<void>;
};
protected transactionMutex: {
lock: () => Promise<void>;
unlock: () => Promise<void>;
};
protected transactionKey: QueryKey | null;
protected proxy: WorkerProxy;
protected reinitChannel?: BroadcastChannel;
onmessage?: (message: OutputMessage, transfer: Transferable[]) => void;
constructor(driver: SQLocalDriver);
protected init: (reason: ConnectReason) => Promise<void>;
postMessage: (event: InputMessage | MessageEvent<InputMessage>, _transfer?: Transferable) => Promise<void>;
protected emitMessage: (message: OutputMessage, transfer?: Transferable[]) => void;
protected editConfig: (message: ConfigMessage) => void;
protected exec: (message: QueryMessage | BatchMessage | TransactionMessage) => Promise<void>;
protected execInitStatements: () => Promise<void>;
protected getDatabaseInfo: (message: GetInfoMessage) => Promise<void>;
protected createUserFunction: (message: FunctionMessage) => Promise<void>;
protected initUserFunction: (fn: UserFunction) => Promise<void>;
protected importDb: (message: ImportMessage) => Promise<void>;
protected exportDb: (message: ExportMessage) => Promise<void>;
protected deleteDb: (message: DeleteMessage) => Promise<void>;
protected destroy: (message?: DestroyMessage) => Promise<void>;
}