Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Polyglot

Rust/Wasm-powered SQL transpiler for 32+ dialects, inspired by [sqlglot](https://github.com/tobymao/sqlglot).
Rust/Wasm-powered SQL transpiler for 33+ dialects, inspired by [sqlglot](https://github.com/tobymao/sqlglot).

Polyglot parses, generates, transpiles, and formats SQL across 32+ database dialects. It ships as:
Polyglot parses, generates, transpiles, and formats SQL across 33+ database dialects. It ships as:
- a Rust crate ([`polyglot-sql`](https://crates.io/crates/polyglot-sql/))
- a TypeScript/WASM SDK ([`@polyglot-sql/sdk`](https://www.npmjs.com/package/@polyglot-sql/sdk))
- a Python package ([`polyglot-sql`](https://pypi.org/project/polyglot-sql/))
Expand All @@ -14,7 +14,7 @@ Release notes are tracked in [`CHANGELOG.md`](CHANGELOG.md).

## Features

- **Transpile** SQL between any pair of 32 dialects
- **Transpile** SQL between any pair of 33 dialects
- **Parse** SQL into a fully-typed AST
- **Generate** SQL back from AST nodes
- **Format** / pretty-print SQL
Expand All @@ -27,17 +27,17 @@ Release notes are tracked in [`CHANGELOG.md`](CHANGELOG.md).
- **C FFI** shared/static library for multi-language bindings (`polyglot-sql-ffi`)
- **Python bindings** powered by PyO3 (`polyglot-sql` on PyPI)

## Supported Dialects (32)
## Supported Dialects (33)

| | | | | |
|---|---|---|---|---|
| Athena | BigQuery | ClickHouse | CockroachDB | Databricks |
| Doris | Dremio | Drill | Druid | DuckDB |
| Dune | Exasol | Fabric | Hive | Materialize |
| MySQL | Oracle | PostgreSQL | Presto | Redshift |
| RisingWave | SingleStore | Snowflake | Solr | Spark |
| SQLite | StarRocks | Tableau | Teradata | TiDB |
| Trino | TSQL | | | |
| Dune | Exasol | Fabric | HANA | Hive |
| Materialize | MySQL | Oracle | PostgreSQL | Presto |
| Redshift | RisingWave | SingleStore | Snowflake | Solr |
| Spark | SQLite | StarRocks | Tableau | Teradata |
| TiDB | Trino | TSQL | | |

## Quick Start

Expand Down
1 change: 1 addition & 0 deletions crates/polyglot-sql-ffi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ Dialect identifiers are string names used in core `polyglot-sql`, for example:
- `snowflake`
- `duckdb`
- `clickhouse`
- `hana`

For a complete runtime list, call `polyglot_dialect_list()`.

Expand Down
3 changes: 2 additions & 1 deletion crates/polyglot-sql-ffi/src/dialects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use polyglot_sql::dialects::DialectType;
use std::os::raw::c_char;
use std::ptr;

const DIALECTS: [DialectType; 34] = [
const DIALECTS: [DialectType; 35] = [
DialectType::Generic,
DialectType::PostgreSQL,
DialectType::MySQL,
Expand Down Expand Up @@ -38,6 +38,7 @@ const DIALECTS: [DialectType; 34] = [
DialectType::Dremio,
DialectType::Exasol,
DialectType::DataFusion,
DialectType::HANA,
];

/// Return supported dialect names as JSON.
Expand Down
3 changes: 2 additions & 1 deletion crates/polyglot-sql-ffi/tests/ffi_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1257,8 +1257,9 @@ fn test_dialect_list_and_count() {
let list: Vec<String> = serde_json::from_str(&json).expect("invalid dialect list json");
let count = polyglot_dialect_count();
assert_eq!(list.len() as i32, count);
assert!(count >= 32);
assert!(count >= 35);
assert!(list.iter().any(|d| d == "generic"));
assert!(list.iter().any(|d| d == "hana"));
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions crates/polyglot-sql-python/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# polyglot-sql (Python)

Rust-powered SQL transpiler for 30+ dialects.
Rust-powered SQL transpiler for 33+ dialects.

The `polyglot-sql` Python package exposes an API backed by the Rust `polyglot-sql` engine for fast parse/transpile/generate/format/validate workflows.

Expand Down Expand Up @@ -203,7 +203,7 @@ All functions are exported from `polyglot_sql`.

Current dialect names returned by `polyglot_sql.dialects()`:

`athena`, `bigquery`, `clickhouse`, `cockroachdb`, `datafusion`, `databricks`, `doris`, `dremio`, `drill`, `druid`, `duckdb`, `dune`, `exasol`, `fabric`, `generic`, `hive`, `materialize`, `mysql`, `oracle`, `postgres`, `presto`, `redshift`, `risingwave`, `singlestore`, `snowflake`, `solr`, `spark`, `sqlite`, `starrocks`, `tableau`, `teradata`, `tidb`, `trino`, `tsql`.
`athena`, `bigquery`, `clickhouse`, `cockroachdb`, `datafusion`, `databricks`, `doris`, `dremio`, `drill`, `druid`, `duckdb`, `dune`, `exasol`, `fabric`, `generic`, `hana`, `hive`, `materialize`, `mysql`, `oracle`, `postgres`, `presto`, `redshift`, `risingwave`, `singlestore`, `snowflake`, `solr`, `spark`, `sqlite`, `starrocks`, `tableau`, `teradata`, `tidb`, `trino`, `tsql`.

## Error Handling

Expand Down
2 changes: 1 addition & 1 deletion crates/polyglot-sql-python/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Use `polyglot_sql.dialects()` to retrieve supported dialect names at runtime.
```python
polyglot_sql.dialects()
# ["athena", "bigquery", "clickhouse", "databricks", "doris", "drill",
# "duckdb", "generic", "hive", "materialize", "mysql", "oracle",
# "duckdb", "generic", "hana", "hive", "materialize", "mysql", "oracle",
# "postgres", "presto", "redshift", "snowflake", "spark", "sqlite",
# "starrocks", "tableau", "teradata", "trino", "tsql", ...]
```
2 changes: 1 addition & 1 deletion crates/polyglot-sql-python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "maturin"
[project]
name = "polyglot-sql"
dynamic = ["version"]
description = "Rust-powered SQL transpiler for 32+ dialects. Parse, generate, transpile, format, and validate SQL."
description = "Rust-powered SQL transpiler for 33+ dialects. Parse, generate, transpile, format, and validate SQL."
readme = "README.md"
license = { text = "MIT" }
requires-python = ">=3.9"
Expand Down
2 changes: 1 addition & 1 deletion crates/polyglot-sql-python/python/polyglot_sql/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Polyglot SQL — Rust-powered SQL transpiler for 32+ dialects."""
"""Polyglot SQL — Rust-powered SQL transpiler for 33+ dialects."""

from polyglot_sql._polyglot_sql import (
Expression,
Expand Down
1 change: 1 addition & 0 deletions crates/polyglot-sql-python/src/dialects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const DIALECT_NAMES: &[&str] = &[
"exasol",
"fabric",
"generic",
"hana",
"hive",
"materialize",
"mysql",
Expand Down
1 change: 1 addition & 0 deletions crates/polyglot-sql-python/tests/test_dialects.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def test_dialects_contains_known_values():
assert "snowflake" in values
assert "bigquery" in values
assert "duckdb" in values
assert "hana" in values


def test_version_is_exposed():
Expand Down
2 changes: 2 additions & 0 deletions crates/polyglot-sql-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ all-dialects = [
"dialect-druid", "dialect-solr", "dialect-tableau",
"dialect-dune", "dialect-fabric", "dialect-drill",
"dialect-dremio", "dialect-exasol", "dialect-datafusion",
"dialect-hana",
]
dialect-postgresql = ["polyglot-sql/dialect-postgresql"]
dialect-mysql = ["polyglot-sql/dialect-mysql"]
Expand Down Expand Up @@ -107,6 +108,7 @@ dialect-drill = ["polyglot-sql/dialect-drill"]
dialect-dremio = ["polyglot-sql/dialect-dremio"]
dialect-exasol = ["polyglot-sql/dialect-exasol"]
dialect-datafusion = ["polyglot-sql/dialect-datafusion"]
dialect-hana = ["polyglot-sql/dialect-hana"]
function-catalog-clickhouse = [
"dialect-clickhouse",
"semantic",
Expand Down
2 changes: 2 additions & 0 deletions crates/polyglot-sql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ all-dialects = [
"dialect-druid", "dialect-solr", "dialect-tableau",
"dialect-dune", "dialect-fabric", "dialect-drill",
"dialect-dremio", "dialect-exasol", "dialect-datafusion",
"dialect-hana",
]
dialect-postgresql = []
dialect-mysql = []
Expand Down Expand Up @@ -82,6 +83,7 @@ dialect-drill = []
dialect-dremio = []
dialect-exasol = []
dialect-datafusion = []
dialect-hana = []
function-catalog-clickhouse = [
"semantic",
"dep:polyglot-sql-function-catalogs",
Expand Down
4 changes: 2 additions & 2 deletions crates/polyglot-sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Part of the [Polyglot](https://github.com/tobilg/polyglot) project.
- **Parse** SQL into a fully-typed AST with 200+ expression types
- **Parse standalone data types** such as `DECIMAL(10, 2)` without a statement wrapper
- **Generate** SQL from AST nodes for any target dialect
- **Transpile** between any pair of 32 dialects in one call
- **Transpile** between any pair of 33 dialects in one call
- **Format** / pretty-print SQL
- **Fluent builder API** for constructing queries programmatically
- **AST traversal** utilities (DFS/BFS iterators, transform, walk)
Expand Down Expand Up @@ -448,7 +448,7 @@ assert_eq!(err.line(), None);

## Supported Dialects

Athena, BigQuery, ClickHouse, CockroachDB, Databricks, Doris, Dremio, Drill, Druid, DuckDB, Dune, Exasol, Fabric, Hive, Materialize, MySQL, Oracle, PostgreSQL, Presto, Redshift, RisingWave, SingleStore, Snowflake, Solr, Spark, SQLite, StarRocks, Tableau, Teradata, TiDB, Trino, TSQL
Athena, BigQuery, ClickHouse, CockroachDB, Databricks, Doris, Dremio, Drill, Druid, DuckDB, Dune, Exasol, Fabric, HANA, Hive, Materialize, MySQL, Oracle, PostgreSQL, Presto, Redshift, RisingWave, SingleStore, Snowflake, Solr, Spark, SQLite, StarRocks, Tableau, Teradata, TiDB, Trino, TSQL

## Feature Flags

Expand Down
Loading