Skip to content

Commit ed5bb49

Browse files
authored
fix: Drizzle query returning an array-in-array type: (#430)
1 parent a547fc6 commit ed5bb49

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/honest-mugs-yawn.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@powersync/drizzle-driver': patch
3+
---
4+
5+
Fixed a typing issue related to queries returning multiple results when used in `db.watch()`.

packages/drizzle-driver/src/sqlite/db.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import type { DrizzleConfig } from 'drizzle-orm/utils';
2121
import { toCompilableQuery } from './../utils/compilableQuery';
2222
import { PowerSyncSQLiteSession, PowerSyncSQLiteTransactionConfig } from './sqlite-session';
2323

24-
export type DrizzleQuery<T> = { toSQL(): Query; execute(): Promise<T> };
24+
export type DrizzleQuery<T> = { toSQL(): Query; execute(): Promise<T | T[]> };
2525

2626
export class PowerSyncSQLiteDatabase<
2727
TSchema extends Record<string, unknown> = Record<string, never>

0 commit comments

Comments
 (0)