Skip to main content

refuse_to_open_db

Function refuse_to_open_db 

Source
pub fn refuse_to_open_db(path: &Path) -> ForgeResult<()>
Expand description

Refuses to open a database that is not a verified Forge DB.

Checks (all must pass):

  1. File must be a valid SQLite database (magic bytes check).
  2. PRAGMA user_version must be within valid range.
  3. Table forge_meta must exist.
  4. forge_meta row key = 'schema_hash' must exist.
  5. forge_meta.value for schema_hash must equal the compiled-in FORGE_SCHEMA_HASH.