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

Function platform_safe_synchronous_mode

src/db/connection.rs:99–107  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

97/// production) this returns `OFF` on every platform, skipping fsyncs entirely
98/// at the cost of crash durability.
99pub(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.
110pub struct Database {

Callers 2

open_localMethod · 0.85
apply_pragmasMethod · 0.85

Calls 1

Tested by

no test coverage detected