Datoria · SQL, compiled
Your SQL exactly as written — comments, casing, habits and all. dfmt is our free formatter: 43 dialects, native dbt and Jinja, idempotent. dquery is the compiler underneath it, licensable for products that need parsing, lineage, and types.
SQL dialects
43
Every common database, from one grammar.
dbt models formatted
26 943
Across 164 public projects.
Formatting errors
1
In the entire corpus, at any width.
AST node types
5 480
Typed and immutable, generated per dialect.
The engine · dquery
Into a lossless syntax tree — every token kept. One grammar in, a whole semantic stack out, and the tools cannot disagree about what your SQL means.
If your product is built on SQL — catalogues, governance, DSPM, ELT and migration tools, IDE plugins, agentic-SQL tools, engines that need a real SQL front end — dquery is the compiler underneath. Not publicly available; we are letting a small number of companies in early.
One declarative definition. Pure data, no embedded functions.
Generated per dialect. 5,480 typed, immutable AST interfaces.
Qualified references across nested CTEs, subqueries and lateral joins.
Dialect-aware coercion, function signatures, nullable tracking.
One pass through JOINs, CTEs, window functions and star expansion.
Qualify, simplify, pushdown, unnest, merge, eliminate.
A real Jinja evaluator. 164 public projects compile end to end.
Partial parses with precise positions. It never crashes on broken SQL.
dfmt · free forever
dfmt is the first product we shipped on top of the Datoria compiler. No trial, no signup. The easiest way to show you what the compiler can do is to let you format some SQL with it.
select o.customer_id, count(*) as n,sum(o.total) as revenue from orders ojoin customers c on c.id=o.customer_idwhere o.status in ('paid','shipped')and o.created_at >= '2026-01-01'group by o.customer_id order by revenue descSELECT o.customer_id, count(*) AS n, sum(o.total) AS revenueFROM orders oJOIN customers c ON c.id = o.customer_idWHERE o.status IN ('paid', 'shipped') AND o.created_at >= '2026-01-01'GROUP BY o.customer_idORDER BY revenue DESCWhat it read
To lay that query out, the compiler had to resolve every name, infer every type, and know which physical table each column came from. Here is what it had by the time it started printing.
SELECT o.customer_id,bigint orders.customer_id count(*) AS n,bigint derived, never null sum(o.total) AS revenuenumeric(12,2) orders.totalFROM orders otable analytics.public.ordersJOIN customers ctable analytics.public.customers ON c.id = o.customer_idWHERE o.status IN ('paid', 'shipped')text 2 of 6 known valuesGROUP BY o.customer_idAnd it comes back whole
Dialects that share a grammar share a colour. Adding the next one is a grammar change, not a new parser — which is why the list keeps growing.
BigQuery family
PostgreSQL family
DuckDB family
Spark SQL family
MySQL family
T-SQL family
Trino family
Standalone grammars
The backstory
That was three years ago, and it was the whole reason to start. We like functional programming and data infrastructure, and we like making tools other engineers actually want to use.
So we built a compiler. One declarative grammar generates specialised, JIT-optimised compilers for all 43 SQL dialects we support. Each produces a typed, immutable AST with over 5,480 node types. On top of that: scope resolution, column lineage, type inference, query optimisation, error recovery, and a full Jinja evaluator for dbt projects.
In our benchmarks it is faster than the hand-written Rust and C parsers we have measured against. It passes the official conformance suites for PostgreSQL's libpg_query and Google's ZetaSQL, and it compiles 164 public dbt projects (26,943 models) and traces 99.63% of their 523,838 output columns back to a physical source.
None of it is open source. It is the foundation of what we are building. dfmt is the piece you can use today.


Column lineage and semantic analysis you can verify. An LSP server so your IDE understands SQL the way the compiler does. An agent API for LLM-driven SQL tools. dfmt is the free preview; the rest is on the way.