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

Method open_existing

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

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

Callers

nothing calls this directly

Calls 1

openMethod · 0.45

Tested by

no test coverage detected