Returns the `synchronous` level paired with the current platform journal. `NORMAL` is consistency-safe for WAL because WAL can recover from a missing final fsync, but rollback journals need `FULL` to avoid corruption after an OS crash or power loss. Keep the faster WAL+NORMAL pairing on non-Windows and use DELETE+FULL on Windows. When [`SQLITE_UNSAFE_FAST_ENV`] is `1` (tests/CI only — never set
()
| 97 | /// production) this returns `OFF` on every platform, skipping fsyncs entirely |
| 98 | /// at the cost of crash durability. |
| 99 | pub(crate) fn platform_safe_synchronous_mode() -> &'static str { |
| 100 | if sqlite_unsafe_fast_enabled() { |
| 101 | "OFF" |
| 102 | } else if cfg!(windows) { |
| 103 | "FULL" |
| 104 | } else { |
| 105 | "NORMAL" |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | /// `SQLite` database backing the code graph, powered by libsql. |
| 110 | pub struct Database { |
no test coverage detected