-
Couldn't load subscription status.
- Fork 27
Open
Description
In memory WASM SQLite supports executing queries synchronously in the main thread, without promises, but currently SQLocal interface expects drivers to be asynchronous
It might be good to have a separate Promise-less SQLocal interface (SQLocalSynchronous or something similar)
export interface SQLocalSynchronous {
sql: <Result extends Record<string, any>>(queryTemplate: TemplateStringsArray | string, ...params: unknown[]) => Result[];
batch: <Result extends Record<string, any>>(passStatements: (sql: typeof sqlTag) => Statement[]) => Result[][];
beginTransaction: () => Transaction;
transaction: <Result>(transaction: (tx: {
sql: Transaction["sql"];
query: Transaction["query"];
}) => Result) => Result;
createCallbackFunction: (funcName: string, func: CallbackUserFunction["func"]) => void;
createScalarFunction: (funcName: string, func: ScalarUserFunction["func"]) => void;
createAggregateFunction: (funcName: string, func: AggregateUserFunction["func"]) => void;
getDatabaseInfo: () => DatabaseInfo;
destroy: () => void;
[Symbol.dispose]: () => void;
}I can work on the implementation, if this API makes sense
Metadata
Metadata
Assignees
Labels
No labels