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

Method add

atomic-core/src/pristine/merge.rs:80–86  ·  view source on GitHub ↗

Open one legacy file exclusively, upgrading a redb 2.x file in place. # Errors Fails with `DatabaseAlreadyOpen` when another handle holds the file, and with an I/O `NotFound` when the file no longer exists.

(&mut self, path: &Path)

Source from the content-addressed store, hash-verified

78 /// Fails with `DatabaseAlreadyOpen` when another handle holds the file,
79 /// and with an I/O `NotFound` when the file no longer exists.
80 pub fn add(&mut self, path: &Path) -> PristineResult<()> {
81 let database = open_database(path, false, MERGE_CACHE_BYTES)?;
82 check_schema_version(&database.begin_read()?)?;
83 require_supported_repository_capabilities(&database.begin_read()?)?;
84 self.sources.push((path.to_path_buf(), database));
85 Ok(())
86 }
87
88 /// Write the merged database to `target` and verify it.
89 ///

Callers 2

tableMethod · 0.45
multimapMethod · 0.45

Calls 8

open_databaseFunction · 0.85
check_schema_versionFunction · 0.85
begin_readMethod · 0.80
to_le_bytesMethod · 0.80
pushMethod · 0.45
updateMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected