MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / copy_db_files

Function copy_db_files

tests/mcp_suite/fixture.rs:372–381  ·  view source on GitHub ↗

Copies a SQLite database file together with any `-wal`/`-shm` sidecars.

(src: &Path, dest: &Path)

Source from the content-addressed store, hash-verified

370
371/// Copies a SQLite database file together with any `-wal`/`-shm` sidecars.
372fn copy_db_files(src: &Path, dest: &Path) -> io::Result<()> {
373 fs::copy(src, dest)?;
374 for suffix in ["-wal", "-shm"] {
375 let sidecar = sibling_with_suffix(src, suffix);
376 if sidecar.exists() {
377 fs::copy(&sidecar, sibling_with_suffix(dest, suffix))?;
378 }
379 }
380 Ok(())
381}
382
383fn sibling_with_suffix(path: &Path, suffix: &str) -> PathBuf {
384 let mut name = path.file_name().unwrap_or_default().to_os_string();

Callers 1

seed_storeFunction · 0.85

Calls 2

sibling_with_suffixFunction · 0.85
existsMethod · 0.80

Tested by

no test coverage detected