Skip to content

Commit 93703a0

Browse files
authored
Node: Fix crash in _initialize for external db adapters (#890)
1 parent 4f6ae37 commit 93703a0

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.changeset/wise-wasps-pretend.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@powersync/node': patch
3+
---
4+
5+
Fix crash when initializing with an external database adapter.

packages/node/src/db/PowerSyncDatabase.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ export class PowerSyncDatabase extends AbstractPowerSyncDatabase {
5454
}
5555

5656
async _initialize(): Promise<void> {
57-
await (this.database as WorkerPoolDatabaseAdapter).initialize();
57+
if ('initialize' in this.database) {
58+
await (this.database as WorkerPoolDatabaseAdapter).initialize();
59+
}
5860
}
5961

6062
/**

0 commit comments

Comments
 (0)