Skip to content

SubscribePayload

Defined in: packages/client/src/worker/protocol.ts:385

tab → worker: register a live query. id correlates the initial snapshot; queryId keys subsequent diffs.

optional fields?: string[]

Defined in: packages/client/src/worker/protocol.ts:397

The unique output aliases the worker wraps the query’s columns under so it is safe to MATERIALISE (one per output column, in the compiled SQL’s column order). When omitted, the worker leaves the SQL untouched and returns name-keyed rows; supply it for a JOIN with same-named columns, which live.query/live.incrementalQuery otherwise refuse to materialise (column "title" specified more than once). When present, result columns are the aliases, so pkColumns must name a PK by its alias.


optional keepAliveMs?: number

Defined in: packages/client/src/worker/protocol.ts:412

Per-subscription keep-alive hint (ms) for the worker’s live-query manager (ADR-0040 decision 4): how long the shared registration should be retained after this subscription’s last consumer leaves, so a matching resubscribe reuses it verbatim. When omitted, the worker falls back to liveQueries.defaultKeepAliveMs; absent means “no hint”.


params: unknown[]

Defined in: packages/client/src/worker/protocol.ts:388


optional pkColumns?: string[]

Defined in: packages/client/src/worker/protocol.ts:403

The result’s primary-key columns, driving diff keying (§4). One column → the incremental path (live.incrementalQuery); many → worker-side diff by composite PK; empty/absent → value-identity fallback for a keyless query. When fields is supplied these name the ALIASED result columns.


queryId: string

Defined in: packages/client/src/worker/protocol.ts:386


sql: string

Defined in: packages/client/src/worker/protocol.ts:387


optional use?: string[]

Defined in: packages/client/src/worker/protocol.ts:405

Lazy relations to activate before the query runs (ADR-0021), forwarded to the worker’s prepareQuery.