Expand description
Thin wrapper over the sqlparser crate that produces a normalized
SqlAnalysis for the guard to evaluate.
Goals:
- Keep
sqlparsertypes out of the guard surface. Everything the guard consumes is a plainString,Vec<String>, or anSqlOperation. - Extract the four things the guard cares about: the operation class,
the referenced tables, the projected columns per table (for
SELECTonly), and whether aWHEREclause is present. - Fail-closed on parse errors: returning an
Errcauses the guard to deny.
Structs§
- SqlAnalysis
- Normalized view of a parsed SQL statement.
Functions§
- parse
- Parse
queryand return a normalized analysis. Parse errors are returned as [Err(String)] so the guard can build aSqlGuardDenyReason::ParseErrorfrom them.