All writing

Writing topic

Governed Text-to-SQL

Turning a natural-language request into a query that is allowed to run: deterministic SQL admission, server-owned grain safety and execution-based evaluation over changing states.

Governed Text-to-SQL writing

4 min read

A SUM That Counts the Parent Three Times

A join to a one-to-many child table can silently triple a parent measure, and the query still looks correct. This is why grain safety belongs to the server, not to the model that wrote the SQL.

  • Data Engineering
  • SQL
  • Grain
  • Text-to-SQL
  • Governance
Read
4 min read

The Model Wrote the SQL. It Doesn't Get to Run It.

Between a model writing a query and a database running it sits an admission chain that ends in a capability object. The executor runs an accepted QueryPlan, not raw SQL, so passing every gate is the only path to execution.

  • Text-to-SQL
  • SQL
  • Execution Authority
  • Governance
  • PostgreSQL
Read
4 min read

Your Text-to-SQL Benchmark Is Measuring the Wrong Thing

Exact-match and single-state checks pass wrong SQL that happens to return the right rows. Correctness has to be execution across counterfactual database states, and mutation testing is how you prove the test can tell right from wrong.

  • Data Engineering
  • SQL
  • Text-to-SQL
  • Evaluation
  • Testing
Read