Publish a table
Declare the sync withtableSync from @bijectionhq/library-transfer, naming the table
and the dataset it is kept in. The transfer({...}) subtree is placed in your
tree beside the Datasets installation:
bijection/app.ts
transfers.lake.attach({ sync: "orders" })
creates the dataset in into.catalog if absent and declares the sync to the
Datasets installation. Register the writer as the feed’s consumer with
transfers.feeds.register({ sync, consumer, principal, authorization: "principal" }), where principal
is the writer’s complete service: principal ID. Grant that principal the
exporter role.
An erasable table needs erasure: "release" on its tableSync before its facts
may leave to a destination outside Bijection. A group of up to
sixteen tables (tableSync({ tables: { a, b }, shape, into })) is kept table by
table, each in its own dataset, committed together at one version.
Mirror or change log
shape: "mirror"keeps the table’s current state: each page collapses to every fact’s last change.shape: "log"keeps every change, insert-only.
How a table becomes a dataset
The writer loops:transfers.feeds.page({ sync, consumer, ack })reads the next page.transfers.lake.next({ sync, consumer })answers what to stage: the generation, ordinal, parent snapshot, target ref and the exact snapshot summary to write.- The writer writes the files and adds the snapshot with that summary, moving no ref.
transfers.lake.stageasks the Datasets installation to commit it (a task of itsstagingtarget). The writer readstransfers.lake.committedand acknowledges the page only onpublished; it stages again onrestageorfailed, and starts a new generation (ack: 0) onreset.
main only when the backfill is complete, so readers never see
a partial table.
A confirmed range is a snapshot on main. The head is tagged as a version at
the sync’s publication cadence (hourly by default) or when you submit to
lake.pinning with { dataset, ref: null }; a default read leases the head
directly.
Check that it has caught up
freshness is "1m" (default), "15m" or "1h"; the writer pages at half of
it. lake.syncs.get({ dataset, ref: null }) answers the generation, confirmed
ordinal, head, cursor, lag (the age of the oldest change no ordinal carries)
and stale (lag above the bound). transfers.feeds.status shows the
consumer’s side. The feed keeps seven days of history by default; a consumer
idle longer starts again from a new snapshot.
Query it from your engine
Open a read lease and pass it to your engine, or publish a view.Adopt a snapshot a partner wrote
A partner or engine that lands a whole snapshot in the managed catalog has it adopted as the next version with the transfer library’sdatasetLoad, through
the dataset’s admit gate. Use it for datasets that are not synced.