MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / open_existing

Method open_existing

atomic-core/src/pristine/txn/pristine.rs:199–203  ·  view source on GitHub ↗

Open an existing pristine database without the table-init write lock. Unlike [`open`](Self::open), this method skips the `begin_write()` + table-initialization transaction. It assumes all tables already exist (true for any database previously created by `open` or `init`). The returned `Pristine` still supports [`write_txn`](Self::write_txn) — the write lock is deferred until you actually need o

(path: P)

Source from the content-addressed store, hash-verified

197 /// Returns an error if the database file doesn't exist, is corrupted,
198 /// or the ID-scan read transaction fails.
199 pub fn open_existing<P: AsRef<Path>>(path: P) -> PristineResult<Self> {
200 let cache_bytes = 8 * 1024 * 1024 * 1024; // 8 GiB
201 let db = Builder::new().set_cache_size(cache_bytes).open(path)?;
202 Self::scan_ids(db)
203 }
204
205 /// Open an existing pristine database in read-only mode
206 ///

Callers

nothing calls this directly

Calls 1

openMethod · 0.45

Tested by

no test coverage detected