feat: support every dialect sqlparser exposes - #18
Merged
Merged
Conversation
Adds DuckDb, Redshift, Spark, ClickHouse, SQLite, MsSql, Oracle, and Teradata, so `Dialect` now covers all 16 dialects in sqlparser 0.62. Name handling moves into the core crate as `FromStr`, `Display`, `Dialect::name`, and `Dialect::ALL`, with a new `UnknownDialect` error whose message lists every valid name. The CLI and the Python binding each kept their own copy of the string table; they can now share this one. `Dialect` becomes `#[non_exhaustive]` and gains `PartialEq`/`Eq`/`Hash`. sqlparser adds dialects over time, and marking it now — while adding variants is already a breaking change — keeps the next addition from being one. Trino is not included: sqlparser 0.62 has no Trino dialect, and aliasing it to `GenericDialect` would advertise support that is not there. `generic` parses Trino/Presto in practice, which the README now says. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The CLI's `parse_dialect` and the Python binding's inline match each held their own copy of the name table, so every new dialect had to be added in three places and the CLI's error message listed the names a fourth time. Both now call `str::parse` and print `UnknownDialect`, which builds the list from `Dialect::ALL`. CLI behavior is unchanged: unknown names still print to stderr and exit 1. README and the Python type stub list the full set. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
funcpp
force-pushed
the
feat/expand-dialects
branch
from
September 21, 2026 05:10
5c9fec8 to
5e352a0
Compare
This was referenced Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reconstructed from the dialect portion of #16, one of the contributions in #15.
What
Adds the 8 dialects
sqlparser0.62 exposes but this crate did not:duckdb,redshift,spark,clickhouse,sqlite,mssql,oracle,teradata.Dialectnow covers all 16.Name parsing moves into the core crate:
impl FromStr for Dialect— canonical names plus the aliasespostgres,sparksql,tsql,sqlserver; case-insensitiveimpl Display for Dialect,Dialect::name(),Dialect::ALL,Dialect::names()UnknownDialecterror whose message lists every valid nameDialectbecomes#[non_exhaustive]and gainsPartialEq/Eq/HashThe CLI and the Python binding now call
str::parseinstead of each keeping a copy of the name table.Why
#[non_exhaustive]: adding enum variants is already breaking, so this is the release to mark it — the next dialect addition then isn't.Differences from #16
oracleandteradata, which feat: expose lineage uncertainty and expand dialects #16 missed. Both exist in sqlparser 0.62.trino. feat: expose lineage uncertainty and expand dialects #16 mapped it toGenericDialect; sqlparser 0.62 has no Trino dialect, so that advertises support that isn't there and would change behavior silently if sqlparser later adds one. The README instead notes thatgenericparses Trino/Presto in practice.duck_db,click_house,ms_sql,t-sql,spark2— they look derived from Rust variant names rather than real usage.ColumnOriginandColumnLineage; those are separate decisions.Tests
3 new, 91 total:
every_dialect_parses_a_basic_query— every variant is wired to a working sqlparser dialectcanonical_names_round_trip—name()andfrom_strare separate tables; this keeps them agreeingaliases_and_mixed_case_resolveCLI checked by hand:
-d duckdb,-d tsql, and-d presto(exits 1 with the full list).Compatibility
Breaking for exhaustive downstream matches on
Dialect— a minor bump (0.3.0). CLI behavior is unchanged: unknown names print to stderr and exit 1.🤖 Generated with Claude Code