Skip to content
Merged
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
7 changes: 2 additions & 5 deletions docs/syntax-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -231,7 +230,7 @@ parses a SQL string in one call.
# Static configuration maps

This module also exports several `LazyLock<HashSet<TokenType>>` 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`
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 3 additions & 4 deletions website/src/content/docs/docs/credits.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading