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)
| 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`]). |
| 888 | pub(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 | |
| 897 | fn row_to_object_record(row: sqlx::sqlite::SqliteRow) -> ObjectRecord { |
| 898 | let resource_version_i64: i64 = row.try_get("resource_version").unwrap_or(1); |