@@ -11,8 +11,8 @@ import type {
1111import sqlite3InitModule from '@sqlite.org/sqlite-wasm' ;
1212import initWasm , { DB } from '@vlcn.io/crsqlite-wasm' ;
1313import { Mutex } from 'async-mutex' ;
14- import { DbSchema } from 'electric-sql/client/model' ;
1514import type { ElectricClient } from 'electric-sql/client/model' ;
15+ import { DbSchema } from 'electric-sql/client/model' ;
1616import { ElectricDatabase , electrify } from 'electric-sql/wa-sqlite' ;
1717import 'fake-indexeddb/auto' ;
1818import '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