Skip to content

Options and policies

Options for open and open_revision. Omitting the options object selects the ordinary behavior; each setting has exactly one owner. connection configures the database convenience connection or a snapshot’s sole read connection.

Options owned by a Remote: authenticated read concurrency (default 32, capped at 256), publication write concurrency, and an optional retention policy.

Options owned by one connection: busy timeout, the Rows bound maximum_rows, and the prefetch and checkpoint policies.

When and how a remote-backed database synchronizes.

Construct through the factories only: :meth:automatic (the default for a writable remote-backed database) or :meth:manual.

SyncPolicy.automatic(*, outbound_debounce_ms: 'int' = 30, active_pull_interval_ms: 'int' = 200, idle_pull_interval_ms: 'int' = 1000, retry_initial_ms: 'int' = 250, retry_max_ms: 'int' = 30000) -> 'SyncPolicy'

Section titled “SyncPolicy.automatic(*, outbound_debounce_ms: 'int' = 30, active_pull_interval_ms: 'int' = 200, idle_pull_interval_ms: 'int' = 1000, retry_initial_ms: 'int' = 250, retry_max_ms: 'int' = 30000) -> 'SyncPolicy'”

Automatic bidirectional synchronization with bounded timers: outbound debounce 30 ms, active follow-up 200 ms, idle poll 1,000 ms, exponential transient retry 250 ms to 30,000 ms. Timer values are positive, bounded at one day; idle polling is never faster than active polling and the retry maximum is never below its initial delay.

Disable automatic synchronization work. Explicit sync() and resolve_conflict() remain available.

Bounded statement and background prefetch for remote-backed connections. Construct through :meth:automatic or :meth:disabled.

PrefetchPolicy.automatic(*, background_target_bytes: 'int' = 0, memory_budget_bytes: 'int' = 67108864) -> 'PrefetchPolicy'

Section titled “PrefetchPolicy.automatic(*, background_target_bytes: 'int' = 0, memory_budget_bytes: 'int' = 67108864) -> 'PrefetchPolicy'”

Enable prefetch. A zero background_target_bytes means the full pinned database within local capacity; the memory budget bounds one wave, not total durable residency.

PrefetchPolicy.disabled() -> 'PrefetchPolicy'

Section titled “PrefetchPolicy.disabled() -> 'PrefetchPolicy'”

Create no prefetch runtime for the connection.

Connection-local WAL checkpoint thresholds for writable databases. Construct through :meth:automatic or :meth:disabled.

CheckpointPolicy.automatic(*, soft_limit_bytes: 'int' = 67108864, forced_limit_bytes: 'int' = 134217728) -> 'CheckpointPolicy'

Section titled “CheckpointPolicy.automatic(*, soft_limit_bytes: 'int' = 67108864, forced_limit_bytes: 'int' = 134217728) -> 'CheckpointPolicy'”

Automatic checkpoints: soft work above soft_limit_bytes at low priority, and a guaranteed attempt before later write-capable work above forced_limit_bytes (never below the soft limit).

CheckpointPolicy.disabled() -> 'CheckpointPolicy'

Section titled “CheckpointPolicy.disabled() -> 'CheckpointPolicy'”

Remove automatic checkpoint work without removing explicit Connection.checkpoint().

How many retained revisions a remote keeps before collection.

RetentionPolicy.bounded(*, keep_last: 'int' = 10, collect_at: 'int' = 20) -> 'RetentionPolicy'

Section titled “RetentionPolicy.bounded(*, keep_last: 'int' = 10, collect_at: 'int' = 20) -> 'RetentionPolicy'”

Keep the newest keep_last retained revisions and begin collection only at collect_at or more.