Skip to content

Commit fab7cb3

Browse files
committed
Cast to type for getOptional and getAll
1 parent b80183a commit fab7cb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/powersync-op-sqlite/src/db/OPSQLiteConnection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ export class OPSQLiteConnection extends BaseObserver<DBAdapterListener> {
6464

6565
async getAll<T>(sql: string, parameters?: any[]): Promise<T[]> {
6666
const result = await this.DB.execute(sql, parameters);
67-
return result.rows ?? [];
67+
return (result.rows ?? []) as T[];
6868
}
6969

7070
async getOptional<T>(sql: string, parameters?: any[]): Promise<T | null> {
7171
const result = await this.DB.execute(sql, parameters);
72-
return result.rows?.[0] ?? null;
72+
return (result.rows?.[0] as T) ?? null;
7373
}
7474

7575
async get<T>(sql: string, parameters?: any[]): Promise<T> {

0 commit comments

Comments
 (0)