Skip to main content

Every dialect, understood.

A complete SQL parser, generated from one grammar: 43 dialects, defined once, declaratively. Every token comes back. On top of that parse sits the semantic layer — types, column lineage, optimisation — so your product does not need a SQL compiler team of its own.

Dialects

43

Every common database, from one grammar.

Identity tests

613k+

Parsed and rendered back to the same text.

Roundtrip pass rate

100.0%

Across every dialect on the board.

Per file

44µs

Faster than the Rust and C parsers we measured.

An SQL compiler, generated from a declarative grammar.

Not a hand-written parser, and not a wrapper around a database. SQL is described once as pure data — a declarative grammar — and a code generator emits the entire engine from it. That architecture is where the performance and the precision come from.

  1. 01

    One declarative grammar

    Every SQL construct is written once as pure data — no code, no functions — so the whole grammar can be analyzed statically. 43 dialects share it through inheritance: PostgreSQL extends ANSI, DuckDB extends PostgreSQL. Adding the next one is a grammar change, not a new parser — which is why coverage keeps growing.

  2. 02

    The parser is generated, not written

    The grammar is the source of truth. A language-agnostic code generator reads it and emits the entire parser, lexer, typed AST, and renderer — none of it hand-written. Today it’s a Java library, callable from any JVM language; Rust is next, with Python and TypeScript wrappers likely to follow.

  3. 03

    A semantic layer on top

    Above the parser: scope resolution, type inference, column-level lineage, and a multi-pass optimizer — all dialect-agnostic.

Performance44µs / file

A JVM library that out-parses native code: 2.6x faster than sqlparser-rs (Rust) and 5.0x faster than libpg_query, the C parser inside PostgreSQL. Generated code, not interpreted — zero backtracking, with dispatch trees computed statically from the grammar.

  • Faster than hand-written parsers because the structure is decided at generation time, not at runtime.
  • A Java library today, callable from any JVM language; Rust is next, with native and WebAssembly builds underway.
Precision100.0% pass

Lossless roundtripping: parse and re-render byte-for-byte, every token preserved — keywords, punctuation, even whitespace and comments.

  • 613,988 identity tests from 37 independent sources, each parsed and rendered back to the same text.
  • Fully typed AST — 8,283 immutable node types, not untyped dictionaries.
  • Column lineage and type inference that survive CTEs, subqueries, and window functions.

Types, lineage, and AST, live

Edit the SQL below. The analyzer returns inferred types (with nullability, VARIANT, and struct types), column-level lineage through CTEs and JOINs, and the full typed AST. Switch dialects to see how parsing differs.

Loading playground...

Anything that has to understand SQL.

The hard part — reading SQL precisely, across 43 dialects, with types and lineage — is done. Anything that has to read, check, transform, or trace SQL becomes a product you can build on top. A few of the directions it opens:

AI agents & copilots

Give an agent real tools for SQL: a column’s full lineage to reason about a query, formatting, and verification of the SQL it generates — checked before it ever runs.

Dialect migration

Datoria parses every major dialect today — Snowflake, Redshift, BigQuery, MySQL. Migration becomes paste-and-go for your users, not a six-month consulting engagement.

Pipeline & dbt lineage

Stitch every transformation — raw, templated, or dbt — into one typed graph. Trace any column end to end, and catch type and breaking changes before they ship.

Query-log analysis

Which of last week’s 80,000 queries touch users.email? Seconds, not a manual audit. Pattern mining, regression detection, and BI lineage all fall out of it.

Smarter SQL editors

Column-aware autocomplete, semantic errors, jump-to-definition. The understanding layer ships today — wire it into VS Code, JetBrains, or your own IDE.

Schema evolution

Before a migration applies, flag the views that will break, the policy referencing a renamed column, the ALTER that isn’t type-compatible. Before, not after.

The first product built on it is dfmt, our free SQL formatter.

Full dialects. All 45 of them.
617,814 statements, round-tripped.

Every bar is a complete SQL dialect, DDL through window functions through vendor quirks, proven by parse → render → same text roundtrips on its own corpus — including the official PostgreSQL and Google ZetaSQL compliance suites. The bar's length is the size of that corpus; a coloured arc groups close relatives, dialects that have more in common with each other than with the rest; the dots past a tip are the compatible engines it also answers as.

45 dialects, 617,814 identity round trips. Bar length is corpus size; a coloured arc groups close relatives; dots are compatible engines.45 DIALECTS100%sql == render(parse(sql))FOR ALL 617,814 TESTSPostgreSQL family · 154,022 statements · 100%Spark SQL family · 74,341 statements · 100%MySQL family · 62,114 statements · 100%DuckDB family · 43,815 statements · 100%Trino family · 9,723 statements · 100%T-SQL family · 8,917 statements · 100%BigQuery family · 5,786 statements · 100%Standalone grammars · 255,270 statements · 100%Beyond SQL · 3,826 statements · 100%PostgreSQL · 93,638 statements · 100% · also Citus, TimescaleDB, Aurora PostgreSQL, Neon, Supabase, AlloyDB, Spanner PostgreSQLpostgresYugabyteDB · 48,564 statements · 100%yugabyteCockroachDB · 11,820 statements · 100%cockroachdbSpark SQL · 17,599 statements · 100%sparkApache Hive · 43,674 statements · 100%hiveApache Impala · 12,540 statements · 100%impalaDatabricks SQL · 528 statements · 100%databricksMySQL · 10,107 statements · 100% · also Aurora MySQLmysqlStarRocks · 14,359 statements · 100%starrocksApache Doris · 13,316 statements · 100%dorisMariaDB · 11,203 statements · 100%mariadbSingleStore · 9,661 statements · 100%singlestoreTiDB · 3,306 statements · 100%tidbPlanetScale · 162 statements · 100%planetscaleDuckDB · 43,761 statements · 100%duckdbMotherDuck · 54 statements · 100%motherduckTrino · 5,274 statements · 100%trinoPresto · 4,209 statements · 100%prestoAmazon Athena · 168 statements · 100%athenaStarburst · 43 statements · 100%starburstDuneSQL · 29 statements · 100%duneT-SQL · 8,696 statements · 100% · also Azure SQLtsqlMicrosoft Fabric · 175 statements · 100%fabricAzure Synapse · 46 statements · 100%synapseBigQuery · 5,488 statements · 100%bigqueryCloud Spanner · 298 statements · 100%spannerClickHouse · 194,292 statements · 100% · also chDBclickhouseIBM DB2 · 27,073 statements · 100%db2SQLite · 24,865 statements · 100%sqliteSnowflake · 4,219 statements · 100%snowflakeOracle · 2,857 statements · 100%oracleAmazon Redshift · 1,264 statements · 100%redshiftANSI SQL · 700 statements · 100%ansiPromQL · 2,052 statements · 100%promqlKQL · 1,774 statements · 100%kql

44µs per file

22.9x faster than SQLGlot. No backtracking, linear time, JIT-friendly generated code.

Druid (JVM) (12/15)
27µs0.6x
Datoria (JVM)
44µs1.0x
jOOQ (JVM)
103µs2.4x
sqlparser-rs
114µs2.6x
Polyglot
115µs2.6x
sqloxide
168µs3.8x
Trino (JVM) (14/15)
175µs4.0x
Flink SQL (JVM) (6/15)
200µs4.6x
Spark (JVM)
208µs4.8x
pg_query
217µs5.0x

1000 iterations, 15 files, Apple M1 Max.

From grammar to
column lineage,
in one pipeline

Nine layers, each generated from the same declarative grammar. Nothing below is a separate tool bolted on — it is one compiler, and every stage sees the same typed tree.

  1. Define

    Grammar DSL

    One grammar definition with dialect predicates. Pure data, no embedded functions.

  2. Generate

    Code Generator

    Generates parser, lexer, 8,283 immutable typed AST interfaces, and a renderer per dialect.

  3. Compile

    dbt & Jinja

    Full Jinja evaluator with ref(), source(), var(), config(). Compiles 163 public dbt projects (28,361 models) end-to-end.

  4. Resolve

    Scope Resolution

    Fully qualified references across nested CTEs, subqueries, and lateral joins.

  5. Type

    Type Inference

    20+ rule types, 134 function signatures, dialect-aware coercion, nullable tracking.

  6. Trace

    Column Lineage

    One-pass DAG traces columns through JOINs, CTEs, window functions, and star expansion. Tested across 163 public dbt projects (28,361 models).

  7. Recover

    Error Recovery

    Partial parses with precise error positions. Never crashes on broken or incomplete SQL.

  8. Optimise

    Query Optimizer

    15-pass pipeline: qualify, simplify, pushdown, unnest, merge, eliminate.

  9. Format

    SQL Formatter

    Adaptive formatting with trivia-signal detection. 20 config options, Jinja-aware.

28,361 dbt models. 66,829 SQL files. Zero errors.

We don't shell out to dbt or rely on regex. We wrote our own Jinja parser, evaluator, and dbt project loader, because you can't analyze a template you can't evaluate.

The dbt corpus is 163 public projects. Beside it runs a second one that has nothing to do with dbt: 989 corpora across 15 dialects, 66,829 whole files and 8,497,476 lines of plain SQL — migrations, procedures and client scripts, the kind of code a dbt project never contains. Both parse, render and re-parse with 0 failures and 0 tokens lost.

Jinja parser and evaluator

A purpose-built Jinja engine with its own generated parser (same grammar IR as the SQL parser). Handles macros, filters, control flow, and nested expressions, with proper scoping.

dbt project loader

Reads dbt_project.yml, resolves ref() and source(), loads seeds and schemas, and builds the DAG. Every model is compiled to pure SQL, then parsed, type-checked, and traced for lineage.

Adapter support

dbt-utils, dbt-expectations, and the core adapter macros for Snowflake, BigQuery, PostgreSQL, Redshift, Spark, Databricks, and more. Each project declares its dialect, and the matching parser handles the compiled SQL.

Runtime macros

Some dbt macros call the warehouse at build time (run_query, execute). We analyze the SQL they intend to run statically, so your pipeline doesn't need live database credentials.

One grammar, 43 dialects

Every SQL construct is defined once in a declarative grammar, with dialect predicates picking the variants. Click any element to drill in. Switch dialects to see how the syntax varies.

Loading grammar...

How it stacks up

The other open-source SQL compilers — SQLGlot, SDF, SQLMesh — are now owned by Fivetran or dbt. Datoria is the one that isn't, and the only engine pairing this dialect breadth with full semantic analysis.

DatoriaSQLGlot Python, Fivetran-ownedSDF/Fusion Rust, dbt Labs-ownedCalcite Java, ApachejOOQ Java, commercial
SQL dialects43, growing24+41 (ANSI)20+
Parse speed44µs999µs—221µs103µs
RoundtrippingLosslessLossyLossyLossyLossy
Typed AST3,507 shared + 4,776 dialect typesUntyped dictRust structsJava classesJava DSL
Column lineageYes (O(n))LimitedYesNoNo
Type inferenceDialect-awareLimitedYesYesYes
dbt / JinjaBuilt-inNoBuilt-inNoNo
Error recoveryYesNoNoNoNo
SQL formatterAdaptiveBasicNoNoNo
IndependenceYesFivetrandbt LabsApacheData Geekery

Two ways in.

Try the formatter now. If you want the full engine, we're opening early access to a small number of companies, so get in touch.