Skip to content

Interface: IdbEngine

Defined in: client/src/engine.ts:80

The Engine plus a couple of hooks the sync client needs: direct access to the underlying IDBPDatabase handle and a way to nudge the reactive hub from outside (used when applying server-pull patches).

pauseNotifications / resumeNotifications are used by the rebase path so intermediate writes during optimistic replay don’t fire live queries mid-flight. The pair delivers a single deduplicated notification per touched table at the end.

  • Engine

readonly idb: Promise<IDBPDatabase<unknown>>

Defined in: client/src/engine.ts:81

notify(table): void

Defined in: client/src/engine.ts:82

string

void


notifyBatch(tables): void

Defined in: client/src/engine.ts:91

Notify a set of tables in one shot. IVM refresh dedupes queries across the batch and fetches each source table at most once, so a rebase that touches every table doesn’t burn N × Q getAll calls (where N = table count, Q = watching query count). The reactive hub still receives one notify per table so live selects fire exactly as if notify(table) were called sequentially.

readonly string[]

void


pauseNotifications(): void

Defined in: client/src/engine.ts:92

void


resumeNotifications(): void

Defined in: client/src/engine.ts:93

void


recordTouchedTables(cb): () => void

Defined in: client/src/engine.ts:104

Install a callback that receives every table name touched by subsequent runInsert / runUpdate / runDelete calls, until the returned dispose function is invoked. Used by the sync client’s runMutate to decide whether a mutation’s outbox entry can be skipped (Phase 5 changeLogSuppressed tables live entirely locally — the server never wants their writes). One installed tracker at a time — a caller must dispose before the next call.

(table) => void

() => void


runSelect<T>(ast): Promise<T[]>

Defined in: core/dist/index.d.ts:473

T

SelectQuery

Promise<T[]>

Engine.runSelect


runInsert(ast): Promise<void>

Defined in: core/dist/index.d.ts:474

InsertQuery

Promise<void>

Engine.runInsert


runUpdate(ast): Promise<void>

Defined in: core/dist/index.d.ts:475

UpdateQuery

Promise<void>

Engine.runUpdate


runDelete(ast): Promise<void>

Defined in: core/dist/index.d.ts:476

DeleteQuery

Promise<void>

Engine.runDelete


liveSelect<T>(ast): LiveQuery<T>

Defined in: core/dist/index.d.ts:477

T

SelectQuery

LiveQuery<T>

Engine.liveSelect