Expand description
Schema fixtures and crash checkpoints for tests of the production database.
Structs§
- Connection
- The connection an app’s test opens outside any store, for the coven crate
to name in its own
make_readable_objects. A connection to a SQLite database. - Followed
- A live query’s results as a test follows them: each in the order the query reports it, kept as the latest one seen.
- Statement
Log - The statements that reads ran on the connections this log was given to, in order, from when each connection got it. Clones share one log.
- Test
Authorship - Authorship of test writes, sealed and hashed with one fixed test key for every audience. It opens headers it sealed itself and checks no signature: the database checks roots and openings; sync checks signatures (D9).
- Work
Counter - Injected counter; clones observe the same database, never other test databases.
- Work
Counts - Local database work observed at its execution boundaries.
Enums§
- Outcome
Listing - How an operation a test ends outside a store reaches
coven_operations: listed from its start, which the outcome then completes, or listed only as it ends, underkind. - Write
Checkpoint - Boundaries after a local write’s durable commit, for process-crash tests.
Functions§
- finish_
outside_ store - End the operation
idonconnection, a test’s connection outside any store, with the outcomelistingholds. For an operation thatcoven_operationslists already, the function sets its outcome, asfinish_with_outcomedoes. For one it doesn’t list, the function lists the outcome underkindfirst, aslist_outcomedoes when a refusal ends an invite. The function then deletes the operation’s pending record and its journal row, asfinishdoes. Outside a store no operation holds a claim, so the function checks none. - idle_
writers - Writers for a test not about forgetting kept records: one other device that can still write but never lands a write, so every kept record stays (§16.7).
- journal_
outside_ store - Journal
newonconnection, a test’s connection outside any store, asinsertdoes, and list it incoven_operationsasinsert_for_appdoes whenlisted_asnames its kind. - make_
readable_ objects - Make on
connection, a connection an app’s test opened itself outside any store, every object of coven’s that app SQL may read, as every store makes it: the tables the app’s local triggers may follow,coven_sync_statusandcoven_retry_effectwith their one row, and coven’s views. The function also makes the tables of coven’s own that the views read or that the outside-store writes fill, all empty (readable_schema). The function registers coven’s SQL functions, withdeviceas this device’s id andsync_functionsas the computations of the sync state and of each upload’s phase, which the coven crate passes from sync as its builder does. Nothing transfers files there and nothing watches the network, as on a read-only handle. The test runs this function before the app’s schema, so the app’s triggers and views apply and run as in a store. coven writes no rows on that connection. coven’s triggers that keepcoven_pendingrun there, and the test saves pending records withsave_outside_store. The test writes the rows that coven would write in the other followed tables, and records a user’s original withrecord_user_file. - notes_
migrations - The corresponding app migration sequence.
- notes_
tables - Declarations for a UUID-keyed notes table in the store audience.
- record_
user_ file - Record on
connection, wheremake_readable_objectsmade coven’s objects, the original atpath, last modified atmodified_atand holdingbytes, asfile’s original on this device, as staging it for the cloud records it: its size, modification time, content hash and chunk hashes (§17.3).coven_user_filesthen lists it. - report_
cost - One measured number, as a line
scripts/perf.shreads:COST metric=<name> value=<n> unit=<ms|ratio|count>. Lower is better in every unit. A character inmetricoutside letters, digits and_./-becomes_, so a caller can pass a label unchanged. - report_
time report_costfor a time, in milliseconds.- save_
last_ pass_ outside_ store - Write
last_passas how the last pass ended onconnection, a test’s connection outside any store, assave_last_passdoes. - save_
location_ outside_ store - Write
locationas the recorded location onconnection, a test’s connection outside any store, assave_locationdoes. - save_
outside_ store - Save
recordonconnection, a test’s connection outside any store, assavedoes, so that coven’s triggers show it incoven_pending. - signer
- Fixed member key used to authenticate fixture writes.
- stage_
plaintext - Stage a snapshot’s whole plaintext from
input, one chunk at a time, as sync stages an opened body (§16.2).