Advanced
Advanced operations remain typed and separate from the ordinary path. Options and calls use Python spellings. Each language’s reference gives its own spellings.
Connection.: Run an explicit WAL checkpoint and returncheckpoint() (checkpointed, total)frame counts.Database.: Replace the synchronization policy and return the new status.set_ sync_ policy() Database.: Discard full quarantine records and return the number cleared.clear_ quarantine_ records() Remote.collect(): Collect retired revisions under an explicit retention policy and return aCollectionReport.Remote.: Reopen a remote that an interrupted collection left cleaning.recover_ abandoned_ collection()
admin.reencrypt
Section titled “admin.reencrypt”Publish a verified retained source snapshot into an unpublished target namespace under a new encryption key.
admin.reencrypt( source: Remote, target: Remote, new_key: bytes, *, source_key: bytes | None = None, revision: str | None = None,) -> KeyRotationReportParameters
source: The remote holding the retained source revision.target: The distinct, unpublished target remote.new_key: The new 32-byte encryption key for the target.source_key: The source revision’s encryption key, if encrypted.revision: The retained source revision, or the current head if omitted.
Returns
KeyRotationReport. The source and target revisions and publication result.
Errors
invalid_argument: An argument has the wrong type or value.remote_closed: The remote is closed.invalid_state: The source has no published revision, both keys are equal, or the target cannot accept the rotated data.integrity_failure: A record failed its integrity check during the rotation.wrong_: The current key is wrong, or encrypted data is damaged. Checkkey_ or_ corrupt source_keyand preserve damaged data.encryption_: The source is encrypted, but its key was not supplied. Pass its current key askey_ required source_key.
Other errors can occur. See Errors for every code.
Example
from potluckdb import OpenOptions, Remote, SyncPolicy, admin, openimport secretsoptions = OpenOptions(sync_policy=SyncPolicy.manual())directory = Remote.from_directorywith directory("source") as src, directory("target") as dst: with open("notes", src, options) as db: db.execute("CREATE TABLE note (id INTEGER PRIMARY KEY)") db.sync() report = admin.reencrypt(src, dst, secrets.token_bytes(32)) print(report.published)Details
Supply distinct source and target remotes that you own. The operation uses bounded transfers. After partial immutable uploads, retry with the same new encryption key. Once the target head is published, repeated calls have the same effect. The target head publishes only after every object write completes.
This call does not close either remote. Both remotes stay reserved until the call returns, whether it succeeds or fails.
integrator namespace
Section titled “integrator namespace”The integrator namespace holds the low-level runtime and storage entry points for cooperative hosts.
The files in a database directory
Section titled “The files in a database directory”A database is a directory, not a single file. Inside it:
| File | What it is |
|---|---|
potluckdb_ | Your data. Every page lives here. |
potluckdb_ | Empty, and the one to know about (below). |
potluckdb_, potluckdb_ | Empty, for the same reason. |
potluckdb_ | Coordination between processes. |
. | This device’s identity. |
potluckdb_ is the name SQLite opens the database under, and it is
always zero bytes. Nothing is ever written through it: a custom
virtual file system intercepts every read and write and serves them from
potluckdb_. The real file exists because SQLite’s
locking protocol needs something on disk to lock.
Opening it with the sqlite3 command line tool reports no such table
even for existing tables. You are reading the lock file. Your data is in potluckdb_. Query through the SDK.
Deleting these empty files loses nothing, and they come back on the next open.