MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / sqlite_sidecar_paths

Function sqlite_sidecar_paths

crates/openshell-server/src/persistence/sqlite.rs:888–895  ·  view source on GitHub ↗

Compute the WAL/SHM sidecar paths `SQLite` derives from a main database file (e.g. `foo.db` -> [`foo.db-wal`, `foo.db-shm`]).

(path: &Path)

Source from the content-addressed store, hash-verified

886/// Compute the WAL/SHM sidecar paths `SQLite` derives from a main database file
887/// (e.g. `foo.db` -> [`foo.db-wal`, `foo.db-shm`]).
888pub(super) fn sqlite_sidecar_paths(path: &Path) -> [PathBuf; 2] {
889 let with_suffix = |suffix: &str| -> PathBuf {
890 let mut buf = path.as_os_str().to_os_string();
891 buf.push(suffix);
892 PathBuf::from(buf)
893 };
894 [with_suffix("-wal"), with_suffix("-shm")]
895}
896
897fn row_to_object_record(row: sqlx::sqlite::SqliteRow) -> ObjectRecord {
898 let resource_version_i64: i64 = row.try_get("resource_version").unwrap_or(1);

Calls 1

pushMethod · 0.80