Skip to main content

Module changes

Module changes 

Source
Expand description

changes.list: the documents added, changed or removed between two kept versions of one branch, in (collection, id) order, page by page.

The changes come from the engine’s diff of each shard’s two roots over the revision entries (m\0) alone, so no body is read unless values are asked, and a page costs in proportion to the changes, never to the store. Each shard’s diff resumes after the last key the answer passed, and the shards’ changes are merged in key order, so the sealed next holds one key.

A row’s before and after are the versions its revisions were written at. A record merged in from another branch keeps the version it was written at on its own side; the version the change belongs to is the answer’s to.

A change to a record the caller may not read is absent and not counted, but it is taken against the page’s limit: a page that reaches its limit inside a run of such changes gives no rows and a next. A caller can learn from such pages that changes lie there which it was not given, and their number bounds how many; never which records, or where.

to: {branch} with no version is the head, captured on the first page; the answer’s to names it, and every later page reads at that version from the token, so a writer between pages changes nothing. A live view asks again with from set to the last to it was given. from: {"fork": branch} is the moment that branch forked at, from its fork provenance; to must then be on that branch.

from may be later than to: the answer is then the reverse, what would be undone going back, with added and removed exchanged and each row’s before and after exchanged.

With values, each body is JSON as in query.run’s rows: every number’s text as written, object keys in sorted order. The bytes exactly as stored are documents.get’s raw_json at that version.

Structs§

ChangesRequest
The two moments, the page and the row form a caller asks for.
Context
What one call of changes.list reads with, all owned by the service.
Fork
The moment fork forked at.
Settings
The named limits of changes.list, each set in serve.json or defaulted.

Enums§

Moment
A moment a caller names: a branch at a version, or its head (to only), or the moment a branch forked at (from only).

Functions§

list
One page of the changes request asks for.
with_rows
envelope, an object, as text with rows in place of its own rows member: every body inside rows goes out as the text it is.