Skip to main content

looks_like_sqlite

Function looks_like_sqlite 

Source
pub fn looks_like_sqlite(path: &Path) -> bool
Expand description

Whether path should be routed to the OpenCode SQLite loader instead of the UTF-8 text path (PARITY-16): true when the file’s first 16 bytes are the SQLite magic, OR its extension is .db — the latter so a corrupted/truncated opencode*.db still gets rusqlite’s own “not a database” diagnostic (PARITY-3 AC03) instead of a confusing UTF-8 error. A non-existent path is NOT considered SQLite here — the missing-file diagnostic in that case comes from the normal load path (with_context at the CLI call sites), which already names the path clearly.