The examples use the
orders dataset from the overview
and a datasets client, new Datasets(components.datasets).
Wait for a mutation’s changes
A receipt records the source position a mutation committed. Take it in the mutation whose writes must be visible:bijection/corrections.ts
datasets.covering returns a published version that includes the receipt’s
writes, or null until one is published. Subscribed with useQuery,
it updates as soon as that version exists. A covering version may also include
writes committed after the receipt; it never excludes the receipt’s own. A
receipt needs an established export: datasets.receipt refuses before the
table’s first version is published.
From a terminal, wait for the same coverage with the receipt’s id:
--wait bounds only the observation, up to 10m; publication continues after
the command exits. --binding-revision <revision> waits instead until an
accepted binding revision has published.
A pipeline input declared with basis: "admission" is stricter: it captures
exactly the receipt’s commit. The export ends a publication at every receipt’s
commit, and the run reads that version, which excludes every later write. If
the export has passed the commit without such a version, the run’s input is
blocked with input_unavailable rather than moved to a later version.
Hold versions for a read
A read context fixes an exact publication, or an exact set of versions, for a bounded lease. Open it in a mutation after your own authorization check:datasets.readContext inspects it, datasets.readContextSnapshots returns its
snapshots, and datasets.closeReadContext releases it. The lease defaults to
five minutes, so a reader that stops does not hold versions forever.
Read an exact snapshot
A checkpoint retains exact versions as a named Iceberg tag on every selected table, so a job reads a fixed snapshot even while publication continues:--lease, the checkpoint releases itself when the lease ends unless you
retain it again, so a job that dies does not hold its snapshots forever. A job
holding a producer grant
retains and releases its own leased checkpoints with that grant instead of
these commands.
--datasets names datasets that share one source feed; an event archive is one
dataset. Add --after <receipt> to wait durably for a complete cut that covers
a receipt. Names are 1 to 128 letters, digits, ., _ or -, and a different
selection needs a new name. Bijection never moves or deletes a tag it did not
create.