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

Function view_id

libatomic/examples/replication_acceptance/observe.rs:13–17  ·  view source on GitHub ↗
(root: &Path, name: &str)

Source from the content-addressed store, hash-verified

11use std::{collections::BTreeMap, fs, path::Path};
12
13pub fn view_id(root: &Path, name: &str) -> Result<u64> {
14 let repo = Repository::open_readonly(root)?;
15 let txn = repo.pristine().read_txn()?;
16 Ok(txn.get_view(name)?.ok_or("view missing")?.id)
17}
18pub fn storage(root: &Path, id: Option<u64>) -> Result<Value> {
19 // Diagnostic only: inspect physical rows without a write handle.
20 let db = redb::Builder::new().open_read_only(root.join(".atomic/atomic.redb"))?;

Callers 1

runFunction · 0.85

Calls 3

read_txnMethod · 0.80
pristineMethod · 0.80
get_viewMethod · 0.45

Tested by

no test coverage detected