GSP vs sqlglot: when free stops being enough

sqlglot is the right default. It is excellent, and it is MIT-licensed — which means you may ship it inside your own commercial product for free, and we are not going to pretend otherwise. It handles query-level lineage on cloud warehouses well enough that DataHub reports 97–99% accuracy on it. If it covers your SQL, use it. General SQL Parser is what teams buy at the two points where free runs out: when the SQL that matters is procedural, and when shipping a parser to your own customers means you need a counterparty rather than a warranty disclaimer.

Short answer

Stay on sqlglot if you are in Python, your SQL is queries, and your dialects are in its set. Buy GSP for one of two reasons, not for a feature list: because your transformation logic lives in stored procedures and dynamic SQL that a tolerant parser returns as opaque nodes, or because you are redistributing a parser inside your own product and need a contract rather than a warranty disclaimer. Most teams who should buy GSP keep sqlglot in place and escalate to it.

What a permissive licence does not give you

This is the part that decides most commercial evaluations, and it has nothing to do with grammar quality. MIT lets you ship sqlglot in your product — we are not going to argue otherwise. It also disclaims every warranty, which means the risk stays with you.

 sqlglot (MIT)GSP (commercial)
Shipping it inside your commercial productPermitted. MIT lets you redistribute — with all warranty expressly disclaimed and no indemnity to you or your customer.A Distribution License: a named contract covering redistribution in your product, with Gudu carrying obligations rather than disclaiming them.
When a customer’s SQL breaks the parserYou open a GitHub issue. Maintainers are generous but owe you nothing, and the fix lands when it lands.You send the failing statement and it is scheduled into a release. That is the obligation you are buying, more than the grammar.
Version commitmentYou self-manage. Pinning an old version means you stop receiving fixes for it.You choose the upgrade window; a pinned release keeps receiving fixes under maintenance.
Procurement, security and legal reviewNo counterparty. There is nobody to sign a DPA, complete a security questionnaire, or answer your customer’s auditor.A Hong Kong company on the other side of a contract: security review, VPAT, and audit questions get answered by a person.

Capability by capability

Where sqlglot is better, this table says so. A comparison that has the vendor winning every row is not worth reading.

CapabilitysqlglotGSP
Language / runtimePython (optional Rust tokenizer)Java (JDK 8+) and .NET — in-process, no Python runtime
LicenseMIT open sourceCommercial, with a 90-day free trial
Dialect-to-dialect transpilationYes — the headline feature (e.g. Snowflake → DuckDB), and better at it than GSPNo. GSP parses, validates, formats, rewrites and analyses; it is not a transpiler
Dialects30+ dialects, one shared grammar with per-dialect overrides42 dialects, each with a dedicated grammar — including IBM Db2, Informix, Netezza, Sybase, SAP HANA, Vertica, N1QL, SOQL, GaussDB, Dameng, OceanBase and Power Query M (15 of them on .NET)
Query-level lineage on cloud warehousesStrong. DataHub reports 97–99% accuracy for query lineage built on sqlglot — for SELECT/CTAS/INSERT on Snowflake, BigQuery and Databricks this is the correct defaultEquivalent for this workload. Buying GSP for it alone is not a good reason
Stored procedures / procedural SQLProcedural blocks generally fall back to opaque Command nodes; production T-SQL stored procedures remain a known open gapFully parsed ASTs: PL/SQL packages, types and triggers; T-SQL blocks, TRY/CATCH, EXECUTE; Db2 SQL PL cursors; Teradata procedures and BTEQ
Dynamic SQLNot evaluatedEvaluated — GSP constant-folds EXEC(’…’) strings and parameter bindings to recover lineage from dynamic SQL
Multi-statement scriptsNot a supported unit of analysisParsed as a script, with lineage carried across statements
Syntax validationBest-effort — a tolerant parser by designOffline validation with error positions, no database connection
SQL formattingA pretty-print flagDedicated formatter, 72+ style options

Stay on sqlglot when

  • You are in Python and want an in-process library at no licence cost.
  • You need to transpile SQL between dialects — its core strength, and not something GSP does.
  • Your SQL is queries: SELECT, INSERT, CTAS, views.
  • Your dialects are in its supported set.
  • You are shipping internal tooling, where a warranty disclaimer costs you nothing.

Pay for GSP when

  • You are redistributing a parser inside a product you sell, and your customers’ procurement asks who is accountable.
  • A parse failure in front of your customer is an incident with a deadline, not a backlog item.
  • Stored procedures, packages, triggers or dynamic SQL carry the transformation logic you need to see.
  • You need Db2, Informix, Netezza, Sybase, HANA, Vertica, Teradata BTEQ, N1QL, SOQL, GaussDB, Dameng, OceanBase or Power BI’s M language.
  • Your product runs on the JVM or .NET and a Python sidecar is not acceptable in your deployment.

Test it on the SQL that actually breaks parsers

  1. Pull 20–100 real statements from your target systems. Include your longest stored procedures and any dynamic SQL — the easy queries will pass on both and tell you nothing.
  2. Run them through sqlglot first. Count how many procedure bodies come back as opaque commands or raise errors, and whether any lineage silently loses edges rather than failing loudly.
  3. If that count is zero, you are done and you do not need us.
  4. If it is not zero, send us those exact failures. We will tell you which ones GSP parses today, which are on the roadmap, and which we cannot do either.

Common questions

We already use sqlglot and it works. Why would we pay for anything?

Mostly you should not. If your SQL is queries against cloud warehouses and you are in Python, sqlglot is the right answer and we would use it too. There are two situations where people buy GSP instead: the SQL that matters to them is procedural (stored procedures, packages, triggers, dynamic SQL) and comes back as an opaque node, or they need to ship a parser inside a commercial product and want a counterparty rather than a disclaimer. If neither is true for you, keep your money.

sqlglot is MIT. Can we not just ship it inside our commercial product for free?

Yes, you can, and we will not pretend otherwise — MIT permits redistribution. What it does not do is transfer any risk. The licence disclaims all warranties, so when your customer hits a parse failure in production, the cost and the deadline are yours, and there is no one contractually obliged to help. A Distribution License is not about permission; it is about who carries that obligation. For some products that is worth nothing, and for products sold into regulated enterprises it is often the whole reason for the purchase.

What happens to your advantage when sqlglot adds full procedural SQL support?

Some of it goes away, and we would rather say so than be caught out. sqlglot is well resourced — its parent Tobiko Data was acquired by Fivetran in September 2025 — and procedural support has been on their roadmap. The parsing-depth gap should be expected to narrow over time. What does not narrow is the contractual side: redistribution with indemnity, a scheduled fix path, and an accountable counterparty are structurally unavailable from an open-source project no matter how good the code becomes. If you are choosing on grammar depth alone, re-test both against your own SQL every year.

Can we use sqlglot from Java or C#?

Only by embedding a Python runtime or standing up a sidecar service. Both work and neither is exotic, but we are not aware of a named .NET or JVM product vendor doing it in production — the operational cost usually outweighs the licence saving. GSP ships native Java and .NET editions that run in-process. Note that on the JVM you do have free in-process alternatives (JSqlParser, Apache Calcite); on .NET the free options are T-SQL-only or syntax-only, which is a materially different situation.

Can GSP and sqlglot be used together?

That is the arrangement we recommend most often. Keep sqlglot as the default path for transpilation and query-level work, and escalate to GSP only for what it returns an error or an opaque node on — typically stored procedures, dynamic SQL, and the legacy dialects. You pay for the exceptions rather than replacing something that already works.