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

Method repository_readonly

libatomic/src/daemon/state.rs:219–229  ·  view source on GitHub ↗

Open the repository database READ-ONLY for this query, with the read-concurrency wait: redb refuses any open while a writable handle exists (this or another process), so a short-lived writer — a recording agent turn in another process, a gated mutation in this one — is given [`database_open_wait`] to finish before the read fails. Readers share the database across processes the same way the CLI's q

(&self)

Source from the content-addressed store, hash-verified

217 /// Readers share the database across processes the same way the CLI's
218 /// query commands always have. The caller must hold no other handle.
219 pub fn repository_readonly(&self) -> Result<Repository, Status> {
220 Repository::open_readonly_wait(&self.root, database_open_wait()).map_err(|error| {
221 domain_status(
222 ErrorCode::Repository,
223 format!(
224 "failed to open repository at {}: {error}",
225 self.root.display()
226 ),
227 )
228 })
229 }
230
231 /// Native-index diagnostics must tolerate incomplete derived schemas and
232 /// must not trigger automatic migration or recovery. Repair callers first

Callers 15

sync_credentialsMethod · 0.80
get_change_implFunction · 0.80
list_viewsMethod · 0.80
logMethod · 0.80
recordMethod · 0.80
insert_changesMethod · 0.80
open_sandboxMethod · 0.80
get_file_statesMethod · 0.80
get_changesMethod · 0.80
list_tagsMethod · 0.80
get_tagMethod · 0.80
list_remotesMethod · 0.80

Calls 2

database_open_waitFunction · 0.85
domain_statusFunction · 0.85