From b8cfafc92d1bbacf65716f8e4675e82481cc9b33 Mon Sep 17 00:00:00 2001 From: Kevin Longe <273747162+kvlonge@users.noreply.github.com> Date: Wed, 11 Nov 2026 14:06:23 +0000 Subject: [PATCH] docs: describe Polyglot as inspired by SQLGlot, not a port of it Polyglot describes itself as a Rust SQL transpiler inspired by SQLGlot. The README, the credits page and the syntax notes called it a Rust port of SQLGlot and said SQLQuack's parser follows SQLGlot's design; those claims are removed. The credits keep SQLGlot's test suite as the source of the Snowflake case inputs. --- README.md | 4 ++-- docs/syntax-notes.md | 7 ++----- website/src/content/docs/docs/credits.mdx | 7 +++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 38fcf1a98..b3c69b4f6 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ SQL that runs on two engines doesn't always return the same answer. NULLs, decim SQLQuack checks its conversion rules against real results from the source warehouse. It handles those differences deliberately and gives you precise diagnostics when it can't convert a query - not plausible-looking SQL and crossed fingers. -SQLQuack's parser started as a fork of [Polyglot](https://github.com/tobilg/polyglot), which is itself a Rust port of [SQLGlot](https://github.com/tobymao/sqlglot). The translation to DuckDB, the typing and the recorded evidence behind them are SQLQuack's own. +SQLQuack's parser started as a fork of [Polyglot](https://github.com/tobilg/polyglot), a Rust SQL transpiler inspired by [SQLGlot](https://github.com/tobymao/sqlglot). The translation to DuckDB, the typing and the recorded evidence behind them are SQLQuack's own. - **Check early.** Catch invalid SQL before it reaches the warehouse. - **Test locally.** Convert queries to DuckDB SQL for tests against small fixtures. @@ -100,7 +100,7 @@ Recording needs the dialect's engine: DuckDB and SQLite record locally, while Sn SQLQuack wouldn't exist without two projects: - **[Polyglot](https://github.com/tobilg/polyglot)** by Tobias ([@tobilg](https://github.com/tobilg)). SQLQuack's tokenizer, parser and syntax tree are a modified fork of Polyglot's, and much of that code is still his. Tobias also fixed many issues I reported while building SQLBuild on Polyglot. -- **[SQLGlot](https://github.com/tobymao/sqlglot)** by Toby Mao and contributors. Polyglot is based on SQLGlot's design, and so is SQLQuack's parser. +- **[SQLGlot](https://github.com/tobymao/sqlglot)** by Toby Mao and contributors, for years of work on SQL transpilation that this space builds on. Both are MIT licensed. Their licence texts are in [THIRD_PARTY_NOTICES](THIRD_PARTY_NOTICES) and ship with every release. diff --git a/docs/syntax-notes.md b/docs/syntax-notes.md index 9332eac36..674493c78 100644 --- a/docs/syntax-notes.md +++ b/docs/syntax-notes.md @@ -64,8 +64,7 @@ The struct is `Send + Sync` safe so it can be shared across threads. SQL Expression AST (Abstract Syntax Tree). This module defines all the AST node types used to represent parsed SQL -statements and expressions. The design follows Python sqlglot's expression -hierarchy, ported to a Rust enum-based AST. +statements and expressions, as a Rust enum-based AST. # Architecture @@ -231,7 +230,7 @@ parses a SQL string in one call. # Static configuration maps This module also exports several `LazyLock>` constants -(ported from Python sqlglot's `parser.py`) that classify token types: +that classify token types: - [`TYPE_TOKENS`] -- all tokens that represent SQL data types - [`NESTED_TYPE_TOKENS`] -- parametric types like `ARRAY`, `MAP`, `STRUCT` @@ -318,8 +317,6 @@ bottom-up, using the generated child visitor and an explicit stack. The [`ExpressionWalk::transform_owned`] method provides the same capability as an owned method on `Expression`. -Based on traversal patterns from `sqlglot/expressions.py`. - ## `traversal.rs`: #[derive(Debug, Default)] External parent-tracking context for an expression tree. diff --git a/website/src/content/docs/docs/credits.mdx b/website/src/content/docs/docs/credits.mdx index 4755569be..d3fee5776 100644 --- a/website/src/content/docs/docs/credits.mdx +++ b/website/src/content/docs/docs/credits.mdx @@ -9,10 +9,9 @@ SQLQuack wouldn't exist without two projects: ([@tobilg](https://github.com/tobilg)). SQLQuack's tokenizer, parser and syntax tree are a modified fork of Polyglot's, and much of that code is still his. Its semantic checks and its rule for widening mixed signed and unsigned integers are also ported from Polyglot. -- **[SQLGlot](https://github.com/tobymao/sqlglot)** by Toby Mao and contributors. Polyglot is a - Rust port of SQLGlot and is based on its design, and so is SQLQuack's parser. SQLQuack also uses - the Snowflake SQL of SQLGlot's test suite as case inputs, with the expected answers recorded from - Snowflake itself. +- **[SQLGlot](https://github.com/tobymao/sqlglot)** by Toby Mao and contributors, for years of + work on SQL transpilation that this space builds on. SQLQuack also uses the Snowflake SQL of + SQLGlot's test suite as case inputs, with the expected answers recorded from Snowflake itself. The translation to DuckDB, the typing and the recorded evidence behind them are SQLQuack's own. SQLQuack goes a different way from both projects on translation. It doesn't rewrite the tree and