Skip to main content

Module query_guard

Module query_guard 

Source
Expand description

The raw-query guard (DESIGN-queries.md I3), mirrored from the TS core’s query-guard.ts — the two cores enforce the same rule so query behaves identically through every binding:

  1. READ-ONLY: only select / with / explain / pragma / values may run. A write against the local mirror bypasses the outbox (SPEC §7.1) and silently diverges from the server — writes go through mutate.
  2. ONE STATEMENT: sqlite3_prepare parses only the first statement and silently ignores the tail; instead of ignoring, reject loudly.

Engine-internal reads use the connection directly and never route here.

Functions§

assert_read_only_query
Assert sql is one read-only statement; Err(message) otherwise.