mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-03 05:34:23 +01:00
SqliteWorker: return query result instead of rows for query
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
interface QueryResult {
|
||||
rows: unknown[];
|
||||
numAffectedRows: bigint;
|
||||
insertId: bigint;
|
||||
}
|
||||
|
||||
class SqliteWorker {
|
||||
#path: string;
|
||||
#worker: Worker;
|
||||
@@ -23,7 +29,7 @@ class SqliteWorker {
|
||||
return this.#call(['open', [this.#path]]);
|
||||
}
|
||||
|
||||
async query(sql: string, params?: any): Promise<unknown[]> {
|
||||
async query(sql: string, params?: any): Promise<QueryResult> {
|
||||
await this.ready;
|
||||
return this.#call(['query', [sql, params]]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user