mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Do it the normal way instead of the dumb way
This commit is contained in:
parent
781ca741dd
commit
a4681e7281
1 changed files with 2 additions and 4 deletions
|
|
@ -61,13 +61,11 @@ class DenoSqliteConnection implements DatabaseConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
executeQuery<O>({ sql, parameters }: CompiledQuery): Promise<QueryResult<O>> {
|
executeQuery<O>({ sql, parameters }: CompiledQuery): Promise<QueryResult<O>> {
|
||||||
const query = this.#db.prepareQuery(sql);
|
// @ts-expect-error `parameters` types are incompatible, but they should match in reality.
|
||||||
|
const rows = this.#db.queryEntries(sql, parameters);
|
||||||
|
|
||||||
const rows = query.allEntries(parameters as any);
|
|
||||||
const { changes, lastInsertRowId } = this.#db;
|
const { changes, lastInsertRowId } = this.#db;
|
||||||
|
|
||||||
query.finalize();
|
|
||||||
|
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
rows: rows as O[],
|
rows: rows as O[],
|
||||||
numAffectedRows: BigInt(changes),
|
numAffectedRows: BigInt(changes),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue