DEV.co
Open-Source Databases · tobilg

polyglot

Polyglot is a Rust-based SQL transpiler that converts queries between 32+ database dialects (MySQL, PostgreSQL, Snowflake, BigQuery, etc.). It ships as a Rust crate, TypeScript/WASM SDK, Python package, and Go module, enabling cross-dialect SQL transformation, parsing, formatting, and lineage analysis.

Source: GitHub — github.com/tobilg/polyglot
870
GitHub stars
55
Forks
Rust
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorytobilg/polyglot
Ownertobilg
Primary languageRust
LicenseMIT — OSI-approved
Stars870
Forks55
Open issues3
Latest releasev0.5.14 (2026-07-07)
Last updated2026-07-07
Sourcehttps://github.com/tobilg/polyglot

What polyglot is

Built in Rust with WASM compilation support, Polyglot provides a fully-typed AST parser, query transpiler, and code generator for 32 SQL dialects. Core features include fluent builder APIs, schema-aware validation, column lineage tracking (OpenLineage-compatible), and guard-rail limits (16 MiB input, 1M tokens/AST nodes) to prevent pathological input exhaustion. Stack-safety hardening via stacker on native builds.

Quickstart

Get the polyglot source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/tobilg/polyglot.gitcd polyglot# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Multi-dialect SQL query translation in data platforms

Transpile user queries across heterogeneous warehouse environments (Snowflake → BigQuery, MySQL → PostgreSQL). Ideal for data migration tools, federated query systems, and analytics platforms serving multiple backend dialects.

Data lineage and governance automation

Generate OpenLineage-compatible column lineage payloads and compact query analysis facts for metadata tracking, data catalogs, and compliance tools without building full lineage engines.

SQL formatting and validation in IDE/editor tools

Embed pretty-printing, syntax checking, semantic validation, and programmatic query construction in web-based SQL editors, IDE extensions, and query builders via the WASM SDK or language bindings.

Implementation considerations

  • Language bindings: Rust crate is primary; TypeScript/WASM, Python (PyO3), and Go (C FFI) are available. Choose based on your runtime (Node.js → WASM, backend Python → PyO3, Go services → FFI wrapper).
  • WASM bundle size and latency: WASM SDK is browser-ready but introduces compilation overhead. Test performance in your target environment; native Rust or Python bindings may be faster for server-side.
  • Go FFI runtime dependency: Go bindings require separate polyglot-sql-ffi shared library (`.so`/`.dylib`/`.dll`). No auto-download; manual build or path configuration required.
  • Guard limits are non-configurable in WASM by default (16 MiB input, 1M tokens/AST). Rust, Python, and C FFI expose overrides. Plan tokenization budgets for large queries.
  • No stack overflow protection in WASM (stacker disabled). Deeply nested SQL (>10k nesting levels) may exhaust WASM memory; use guard limits or pre-validate input.

When to avoid it — and what to weigh

  • You need production-grade execution or optimization — Polyglot transpiles and analyzes SQL; it does not execute queries or perform query optimization. For that, use query engines (DuckDB, Presto) or native database engines.
  • You require mature, battle-tested stability in critical systems — Project is ~6 months old (created Jan 2026, latest release Jul 2026). While actively maintained, it lacks long production track record. Enterprise adoption risk requires thorough vetting.
  • You depend on exhaustive dialect coverage or obscure SQL features — Although 32 dialects are supported, edge cases and vendor-specific extensions may not be fully handled. Verify your exact SQL patterns against the playground before committing.
  • You need commercial support, SLAs, or vendor backing — Single-author OSS project (tobilg). No commercial entity, support contracts, or liability guarantees. Community-driven maintenance only.

License & commercial use

MIT License (permissive OSI-approved). Allows commercial use, modification, and distribution with minimal restrictions (require attribution and preserve license notice). No copyleft obligations.

MIT license permits commercial use without requiring source disclosure or reciprocal licensing. However, no warranty, indemnification, or commercial support is provided. Suitable for internal tools and products; review your risk tolerance for critical paths given single-author maintenance and lack of vendor backing.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Guard limits (input size, token budget, AST depth, set-operation chains) mitigate pathological input DoS on format/parse. Stack-safety hardening (stacker) reduces stack overflow risk on native builds. WASM lacks stacker protection. No disclosed security audit, exploit policy, or dependency scanning. Validate untrusted SQL before processing. No cryptographic features; suitable for query transformation only.

Alternatives to consider

sqlglot (Python; Apache 2.0)

Mature SQL transpiler with 20+ dialects, broader ecosystem integration, commercial backing (Databricks-adjacent), and stronger community. Reference for Polyglot design but more established for production use.

prql (Rust; MIT)

Functional SQL query language with Rust foundation and WASM support. Different paradigm (transpile to SQL) vs. dialect-to-dialect. Good for new query construction; less suited for legacy SQL migration.

Native database query rewrite engines (DuckDB Optimizer, Trino Parser)

If you need execution alongside transpilation, DuckDB and Trino include SQL parsing/rewriting. Heavier dependencies but integrated with execution. Better for end-to-end query processing.

Software development agency

Build on polyglot with DEV.co software developers

Evaluate Polyglot on the online playground, then integrate the Rust, Python, TypeScript, or Go SDK into your data platform. Start with syntax transpilation; add lineage and validation as needed.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

polyglot FAQ

Can Polyglot execute SQL queries?
No. Polyglot parses, transpiles, formats, and analyzes SQL. It does not execute queries or interact with databases. Use it as part of a pipeline feeding results to a query engine (DuckDB, your database).
Is lineage tracking available without a schema?
Basic lineage (table-to-table, column references) works without schema. Schema-aware lineage (type hints, nullability, foreign key tracking) requires optional ValidationSchema JSON. See README examples.
Can I use Polyglot in the browser?
Yes, via @polyglot-sql/sdk (WASM). See the online playground (polyglot-playground.gh.tobilg.com) for live examples. Bundle size and latency are typical for WASM; profile in your environment.
What if my SQL dialect is not in the 32 supported?
Polyglot covers major dialects (BigQuery, Snowflake, PostgreSQL, MySQL, Spark, etc.). For niche dialects, check the README table. If missing, open an issue or contribute (MIT license allows forks). Fallback to 'generic' dialect for best-effort parsing.

Work with a software development agency

From first prototype to production, DEV.co delivers software development services around tools like polyglot. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across open-source databases and beyond.

Ready to standardize cross-dialect SQL?

Evaluate Polyglot on the online playground, then integrate the Rust, Python, TypeScript, or Go SDK into your data platform. Start with syntax transpilation; add lineage and validation as needed.