pub struct OpenOptions {
pub readonly: bool,
pub lock: LockMode,
pub snapshot_every: u64,
pub compaction: Option<CatalogCompaction>,
pub cypher: Option<CipherOptions>,
pub follow: FollowOption,
pub cache: CachePolicy,
pub max_image_bytes: Option<u64>,
pub password_hash: PasswordHashParams,
pub layout: LayoutOptions,
}Expand description
How Database::open acquires the writer lock and whether it opens for writing at all.
Fields§
§readonly: bool§lock: LockMode§snapshot_every: u64Ops applied to a table between periodic <table>.idx snapshots — see Table::snapshot.
0 disables periodic snapshotting; defaults to [DEFAULT_SNAPSHOT_EVERY].
compaction: Option<CatalogCompaction>Overrides the automatic-compaction policy of every table for this handle — the TS
compaction option, where Disabled is its false. None leaves the choice to the
catalog: the table’s own options.compaction, then defaults.compaction, then
[DEFAULT_COMPACTION].
cypher: Option<CipherOptions>Keys for the fields a schema marks cypher. Without them such fields cannot be written.
follow: FollowOptionWhether reads catch up with what other processes appended, without an explicit refresh.
cache: CachePolicyHow many parsed documents each table of this handle keeps in memory in front of its log —
see CachePolicy. Disabled by default, and named here rather than in the catalog on
purpose: it costs memory in this process only, so it is the opener’s call and not a property
of the database on disk.
max_image_bytes: Option<u64>Refuses, at write time, an image field whose decoded bytes exceed this many. None accepts
any size. Like cache, it is the opener’s call and not stored in the database; verify’s
own max_image_bytes is the matching check on what is already on disk.
password_hash: PasswordHashParamsArgon2id cost of the hashes written to passwordHash fields by this handle (default 19 MiB,
2 passes, 1 lane). A hash already stored keeps its own cost and still verifies;
verify_password reports needs_rehash for one made with another.
layout: LayoutOptionsWhere in the directory the metadata document and the table files live. Left at its default,
this is the flat arrangement every database used before layouts existed, under
hayson.json — and an existing database is opened in the arrangement it is stored in,
whether or not the caller names one.