Skip to content

Commit 760f842

Browse files
committed
[powersync] New database for tests
1 parent 67e4087 commit 760f842

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
"@cloudflare/workers-types": "^4.20250327.0",
156156
"@electric-sql/pglite": "^0.2.17",
157157
"@eslint/js": "^9.23.0",
158-
"@journeyapps/wa-sqlite": "^0.4.2",
158+
"@journeyapps/wa-sqlite": "^1.2.2",
159159
"@libsql/client": "^0.15.1",
160160
"@powersync/common": "^1.26.0",
161161
"@powersync/react": "^1.5.2",

test/unit/persisters/common/databases.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import type {
1111
import sqlite3InitModule from '@sqlite.org/sqlite-wasm';
1212
import initWasm, {DB} from '@vlcn.io/crsqlite-wasm';
1313
import {Mutex} from 'async-mutex';
14-
import {DbSchema} from 'electric-sql/client/model';
1514
import type {ElectricClient} from 'electric-sql/client/model';
15+
import {DbSchema} from 'electric-sql/client/model';
1616
import {ElectricDatabase, electrify} from 'electric-sql/wa-sqlite';
1717
import 'fake-indexeddb/auto';
1818
import 'jest-fetch-mock';
@@ -88,7 +88,7 @@ const getPowerSyncDatabase = async (
8888

8989
const executeSingle = async (sql: string, bindings: any[]) => {
9090
const results = [];
91-
sqlite3.str_new(db);
91+
9292
for await (const stmt of sqlite3.statements(db, sql)) {
9393
let columns;
9494
const wrappedBindings = bindings ? [bindings] : [[]];
@@ -153,10 +153,10 @@ const getPowerSyncDatabase = async (
153153
while (!signal?.aborted) {
154154
const nextChange = await new Promise<WatchOnChangeEvent>(
155155
(resolve) => {
156-
const observer = (_: any, tableName: string) => {
156+
const observer = (_1: any, _2: any, tableName: string) => {
157157
resolve({changedTables: [tableName]});
158158
};
159-
sqlite3.register_table_onchange_hook(db, observer);
159+
sqlite3.update_hook(db, observer);
160160
},
161161
);
162162
yield nextChange;

0 commit comments

Comments
 (0)