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

Method open_existing

atomic-core/src/pristine/txn/pristine.rs:200–204  ·  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

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

Callers

nothing calls this directly

Calls 1

openMethod · 0.45

Tested by

no test coverage detected