MCPcopy Create free account
hub / github.com/tinyplex/tinybase / getPowerSyncForPersister

Function getPowerSyncForPersister

test/unit/persisters/powersync.test.ts:56–63  ·  view source on GitHub ↗
(powerSync: PowerSyncDatabase)

Source from the content-addressed store, hash-verified

54 (await summarizeBatch(powerSync))[1]?.();
55
56const getPowerSyncForPersister = (powerSync: PowerSyncDatabase): any => ({
57 // The Node SDK's better-sqlite3 adapter expects '?' bindings, while the Web
58 // SDK accepts TinyBase's '$1' bindings. This keeps the test focused on the
59 // real PowerSync CRUD queue behavior rather than adapter placeholder syntax.
60 execute: (sql: string, params?: any[]) =>
61 powerSync.execute(sql.replace(/\$\d+/g, '?'), params),
62 onChange: powerSync.onChange.bind(powerSync),
63});
64
65afterEach(async () => {
66 await Promise.all(powerSyncs.splice(0).map((powerSync) => powerSync.close()));

Callers 1

powersync.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…