deliberate.codes

Weblog of Marco N. - a software guy in data. I build with AI.

SQLingual: one-click SQL dialect translation

Migrating between databases means rewriting SQL. Every platform has its own date functions, string handling, and syntax quirks. What runs on Databricks fails on Exasol. What works in BigQuery breaks in Snowflake.

I built SQLingual (pronounced “es-qu-lingual”) to make switching engines easier.

In this post I’ll explain how it works and what I have learned along the way.

What it does#

SQLingual translates SQL queries between 30 different database dialects. Paste your source query, select target dialect, click transpile. The translation happens instantly in your browser.

SQLingual translating a TPC-H query from Databricks to Exasol

The example above shows a TPC-H query—the standard benchmark for analytical databases—converted from Databricks SQL to Exasol SQL. Notice how table aliases, date literals, and join syntax adapt automatically.

How it works#

SQLingual is powered by sqlglot, an open-source SQL parser and transpiler maintained by Tobiko Data. sqlglot parses SQL into an abstract syntax tree, then generates syntactically correct output for the target dialect.

This isn’t regex find-and-replace. sqlglot understands SQL semantics. It handles:

  • Function mapping: DATE_TRUNC becomes TRUNC or DATE_PART depending on the target
  • Type conversion: Data types translate to their equivalents
  • Syntax differences: CTEs, window functions, and joins adapt to each dialect’s conventions
  • Identifier quoting: Backticks, double quotes, or brackets—whatever the target expects

The app itself is built with Streamlit, which made it trivial to create an interactive UI without writing frontend code.

Supported dialects#

SQLingual supports translation between these databases:

  • Cloud warehouses: BigQuery, Snowflake, Redshift, Databricks, Synapse
  • Traditional databases: PostgreSQL, MySQL, Oracle, SQL Server, SQLite
  • Analytical engines: DuckDB, ClickHouse, Presto, Trino, Spark
  • And more: Exasol, Teradata, Hive, StarRocks, Doris, Drill

sqlglot is very actively maintained, so I expect it to support more dialects in the future.

When to use it#

SQLingual or sqlglot help you with the following:

  • Database migrations: Moving from one platform to another
  • Multi-cloud architectures: Queries that need to run on different engines
  • Learning: Understanding how SQL differs across platforms
  • Quick translations: One-off conversions without setting up tooling

Try it#

SQLingual is a side-project of mine, it’s free and open-source: