Interface: IdbEngine
Interface: IdbEngine
Section titled “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.
Extends
Section titled “Extends”Engine
Properties
Section titled “Properties”
readonlyidb:Promise<IDBPDatabase<unknown>>
Defined in: client/src/engine.ts:81
Methods
Section titled “Methods”notify()
Section titled “notify()”notify(
table):void
Defined in: client/src/engine.ts:82
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
notifyBatch()
Section titled “notifyBatch()”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.
Parameters
Section titled “Parameters”tables
Section titled “tables”readonly string[]
Returns
Section titled “Returns”void
pauseNotifications()
Section titled “pauseNotifications()”pauseNotifications():
void
Defined in: client/src/engine.ts:92
Returns
Section titled “Returns”void
resumeNotifications()
Section titled “resumeNotifications()”resumeNotifications():
void
Defined in: client/src/engine.ts:93
Returns
Section titled “Returns”void
recordTouchedTables()
Section titled “recordTouchedTables()”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.
Parameters
Section titled “Parameters”(table) => void
Returns
Section titled “Returns”() => void
runSelect()
Section titled “runSelect()”runSelect<
T>(ast):Promise<T[]>
Defined in: core/dist/index.d.ts:473
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”SelectQuery
Returns
Section titled “Returns”Promise<T[]>
Inherited from
Section titled “Inherited from”Engine.runSelect
runInsert()
Section titled “runInsert()”runInsert(
ast):Promise<void>
Defined in: core/dist/index.d.ts:474
Parameters
Section titled “Parameters”InsertQuery
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”Engine.runInsert
runUpdate()
Section titled “runUpdate()”runUpdate(
ast):Promise<void>
Defined in: core/dist/index.d.ts:475
Parameters
Section titled “Parameters”UpdateQuery
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”Engine.runUpdate
runDelete()
Section titled “runDelete()”runDelete(
ast):Promise<void>
Defined in: core/dist/index.d.ts:476
Parameters
Section titled “Parameters”DeleteQuery
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”Engine.runDelete
liveSelect()
Section titled “liveSelect()”liveSelect<
T>(ast):LiveQuery<T>
Defined in: core/dist/index.d.ts:477
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”SelectQuery
Returns
Section titled “Returns”LiveQuery<T>
Inherited from
Section titled “Inherited from”Engine.liveSelect