pub struct DatabaseBuilder { /* private fields */ }Expand description
Tuning knobs of a Database. Construct through
Database::builder.
Implementations§
Source§impl DatabaseBuilder
impl DatabaseBuilder
Sourcepub fn fsync(self, policy: FsyncPolicy) -> Self
pub fn fsync(self, policy: FsyncPolicy) -> Self
Journal fsync policy (default: every operation).
Sourcepub fn snapshot_every_ops(self, ops: u64) -> Self
pub fn snapshot_every_ops(self, ops: u64) -> Self
Auto-snapshot after this many mutations (default 1024; 0
disables the count trigger).
Sourcepub fn snapshot_journal_bytes(self, bytes: u64) -> Self
pub fn snapshot_journal_bytes(self, bytes: u64) -> Self
Auto-snapshot when the journal outgrows this many bytes (default
4 MiB; 0 disables the size trigger).
Sourcepub fn maintain_every_forgets(self, forgets: u64) -> Self
pub fn maintain_every_forgets(self, forgets: u64) -> Self
Optional auto-maintain after this many forgets (default off —
maintenance is O(database) and the first pass beyond the HNSW
threshold pays the graph build).
Sourcepub fn embedder(self, embedder: Box<dyn Embedder>) -> Self
pub fn embedder(self, embedder: Box<dyn Embedder>) -> Self
The embedding provider. When set (and its dim() > 0),
remember without a vector embeds the fact text and recall
with a text but no vector embeds the query — both outside the
database lock. Config::dim must equal the embedder’s dimension.
Sourcepub fn open(
self,
path: impl Into<PathBuf>,
) -> Result<(Database, OpenReport), HostError>
pub fn open( self, path: impl Into<PathBuf>, ) -> Result<(Database, OpenReport), HostError>
Opens (or creates) the database at path.
§Errors
HostError::Locked when the file is owned elsewhere;
HostError::Engine for config/snapshot/journal problems
(including an embedder dimension that disagrees with
Config::dim); HostError::Io for filesystem failures.