Parse first
SQL enters a structured parser instead of going directly to a database driver.
SQL Compiler
hs-sql-agent parses SQL into a typed compiler pipeline, validates source semantics and policy, proves target capabilities, and only then emits provider-specific SQL.
SQL enters a structured parser instead of going directly to a database driver.
Unsupported source or target semantics are rejected instead of silently downgraded.
The execution boundary keeps database-specific behavior explicit.
An LLM can propose SQL, but the proposal does not become executable merely because it parses on a database. hs-sql-agent places a compiler and policy boundary between the model and the connection.
The pipeline is designed to fail closed: a statement that cannot be represented or proven safely is rejected rather than rewritten into a different meaning just to make it run.
Queries pass through parsing, binding, validation, capability checks, provider-specific compilation, and immutable command execution. That gives policy enforcement a structured statement to reason about instead of raw text alone.
The supported SQL surface can expand over time without weakening the safety contract. New syntax is added by teaching the parser, typed model, validation, capability proofs, rendering, and tests about the new semantics.