What SQLFix is

SQLFix is a natural-language-to-SQL tool. You describe what you want to know in plain English, optionally paste a table or schema, pick a dialect (PostgreSQL, MySQL, SQLite, or BigQuery), and SQLFix returns a SQL query plus a short, plain-English explanation of how it works.

The part that separates it from a general chat model is the safety screen: every generated query is checked by a deterministic ruleset (sql-safety) that looks for risky patterns — SQL injection, a DROP without a WHERE clause, and dangerous UPDATE/DELETE statements — before the query is shown to you.

What problem it solves

Writing SQL by hand means remembering dialect quirks (date functions differ between Postgres and MySQL; quoting rules differ again in BigQuery) and, more importantly, avoiding destructive mistakes. A missing WHERE on a DELETE can wipe a table. String-concatenated user input can open an injection path. SQLFix is built to surface those issues as findings you can read, not just hand you a query and walk away.

How the safety screen works

The deterministic ruleset runs after generation and flags specific patterns:

  • injection-prone construction (building SQL by string-concatenating input instead of using parameters)
  • DROP / TRUNCATE without a WHERE or other guard
  • UPDATE / DELETE that affects every row
  • obvious syntax problems in the requested dialect

Each finding is attached to the query so you can decide what to do. SQLFix can help you catch the patterns it knows; it is not a substitute for reviewing a query against your own schema and data.

Who it is for

SQLFix is built for people who need correct SQL without an SQL keyboard in front of them all day: product managers and analysts pulling their own numbers, backend developers drafting a query, support engineers answering a data question, and students learning how a question maps to SQL. It is a drafting and review aid, not a database administrator.

An honest limit

SQLFix can help you write a readable, dialect-aware query and flag known-dangerous patterns. It does not guarantee the query is correct, optimal, or safe for your specific schema, and it does not replace a qualified reviewer for anything that writes, deletes, or alters data. Treat its output as a strong first draft that a human still owns.

Authoritative references

  • PostgreSQL documentation: https://www.postgresql.org/docs/current/
  • OWASP Top 10 — Injection: https://owasp.org/Top10/A03_2021-Injection/