FMF SQL Check

Check SQL before you run it: syntax validation with the real PostgreSQL 18 parser and the real SQLite engine (MySQL / MariaDB via node-sql-parser, measured against real MySQL 8.4 and MariaDB 11.8 servers), with the exact error position; 18 lint rules that catch real bugs (UPDATE/DELETE without WHERE, = NULL, NOT IN with NULLs, LIMIT without ORDER BY, comma joins, injection tautologies, non-sargable filters, destructive DDL); and a formatter for 19 dialects that refuses to return output unless it provably means the same query (same PostgreSQL parse tree, same tokens). The SQL is never executed.

Full docs with copy-paste examples (mppx CLI, curl, TypeScript, Python, MCP).

Routes

RoutePriceWhat you get
POST /v1/sql/validate$0.001Validate SQL syntax (real PostgreSQL / SQLite parsers)
Is this SQL syntactically valid? PostgreSQL is checked by the PostgreSQL 18 parser itself (libpg_query) and SQLite by the SQLite engine, so the answer matches the database; MySQL and MariaDB use node-sql-parser (agreement with real MySQL 8.4 / MariaDB 11.8 servers is published). Returns valid, statement count and types, or the error message with position, line, column and the text near it. Unknown tables or columns are not syntax errors. The SQL is never executed.
POST /v1/sql/lint$0.002Lint SQL for bugs, safety and performance
Find real problems before a query runs: UPDATE / DELETE without WHERE, = NULL comparisons, NOT IN (subquery) NULL trap, LIMIT without ORDER BY, comma (cartesian) joins, INSERT without a column list, always-true injection signatures (OR 1=1), stacked statements, destructive DDL, non-sargable filters (LOWER(col) = ...), leading-wildcard LIKE, large OFFSET, ORDER BY ordinals, UNION vs UNION ALL, SELECT *, COUNT(col). Each finding has rule, severity, line, column, snippet and a fix. Includes the syntax check. The SQL is never executed.
POST /v1/sql/format$0.001Format SQL (verified to mean the same query)
Pretty-print SQL for 19 dialects (postgresql, mysql, sqlite, bigquery, snowflake, transactsql, redshift, trino, spark, duckdb, ...): keyword case, indent, tabular styles, expression width. Before returning, every output is checked: same token sequence as the input (comments kept), and for PostgreSQL the same parse tree from the real PostgreSQL parser. If a check fails the output is refused and you are not charged.

Sources and licences

Engines bundled in the worker: libpg_query (PostgreSQL 18 parser, BSD/PostgreSQL licence via libpg-query, MIT), SQLite via sql.js (public domain / MIT), node-sql-parser (Apache-2.0), sql-formatter (MIT). No database access; your SQL is never executed or stored. Operated by FMF Tools (fmf-tools@agentmail.to). Pay per call; invalid input returns 402 and is not charged.

Sister services