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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 15 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[workspace]
members = [
"crates/sqlquack-syntax",
"crates/sqlquack-tokenize",
"crates/sqlquack-syntax-snowflake",
"crates/sqlquack-derive",
"crates/sqlquack-diagnostics",
Expand All @@ -14,7 +15,6 @@ members = [
"crates/sqlquack",
"tools/sqlquack-coverage-check",
"crates/sqlquack-syntax-postgres",
"crates/sqlquack-lint",
"crates/sqlquack-syntax-bigquery",
"crates/sqlquack-syntax-sqlite",
"crates/sqlquack-fingerprint",
Expand Down Expand Up @@ -63,11 +63,11 @@ sqlquack-blocks = { path = "crates/sqlquack-blocks", default-features = false }
sqlquack-evidence = { path = "crates/sqlquack-evidence" }
sqlquack-fingerprint = { path = "crates/sqlquack-fingerprint" }
sqlquack-format = { path = "crates/sqlquack-format" }
sqlquack-lint = { path = "crates/sqlquack-lint" }
sqlquack-parse = { path = "crates/sqlquack-parse" }
sqlquack-policy = { path = "crates/sqlquack-policy" }
sqlquack-semantics = { path = "crates/sqlquack-semantics" }
sqlquack-syntax = { path = "crates/sqlquack-syntax" }
sqlquack-tokenize = { path = "crates/sqlquack-tokenize" }
sqlquack-syntax-snowflake = { path = "crates/sqlquack-syntax-snowflake" }
sqlquack-derive = { path = "crates/sqlquack-derive" }
sqlquack-syntax-postgres = { path = "crates/sqlquack-syntax-postgres" }
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ bundled-extensions:
done

# The crates whose features include dialects, as consumers build them one dialect at a time.
DIALECT_CRATES ?= sqlquack-semantics sqlquack-parse sqlquack-fingerprint sqlquack-format sqlquack-lint \
DIALECT_CRATES ?= sqlquack-semantics sqlquack-parse sqlquack-fingerprint sqlquack-format \
sqlquack-convert sqlquack-diagnostics

# Fails when a DIALECT_CRATES library does not build with one of its dialect features alone. The
Expand Down
4 changes: 1 addition & 3 deletions THIRD_PARTY_NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ polyglot
SQLQuack's tokenizer, parser and syntax tree are a modified fork of polyglot
(https://github.com/tobilg/polyglot), as forked at https://github.com/sqlstack-io/polyglot.
The derived code is in crates/sqlquack-syntax-snowflake, which now holds most of it,
crates/sqlquack-syntax and crates/sqlquack-derive. The corpus
crates/sqlquack-syntax, crates/sqlquack-tokenize and crates/sqlquack-derive. The corpus
corpora/polyglot-check/polyglot_tests.json holds the SQL inputs of polyglot's tests.
DuckDB's widening of a signed integer mixed with an unsigned one, unsigned_coercion in
crates/sqlquack-semantics/src/duckdb/profile/_helpers/duck_types.rs, is ported from polyglot's
Expand All @@ -72,8 +72,6 @@ The semantic checks in crates/sqlquack-semantics/src/lineage/_helpers/checks are
polyglot's validation: the type families in families.rs, the built-in function signatures in
signatures.rs and the scope rules in scope_rules.rs, and the type checks and their messages in
node_checks.rs, relational.rs and sets.rs.
The lint Rules' scope walk and aggregate classifier, in crates/sqlquack-lint/src/tree, are ported
from polyglot's scope.rs and traversal.rs.

polyglot is distributed under the following licence:

Expand Down
1 change: 1 addition & 0 deletions crates/sqlquack-convert/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ sqlquack-blocks.workspace = true
sqlquack-policy.workspace = true
sqlquack-semantics.workspace = true
sqlquack-syntax.workspace = true
sqlquack-tokenize.workspace = true

[dev-dependencies]
# The tests run the Snowflake rules and pipeline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use sqlquack_blocks::raises::main::identify_raises::identify_raises;
use sqlquack_diagnostics::failures::constants::{RAISE_ID_MARKER, TAG_END};
use sqlquack_diagnostics::refusals::models::Refusal;
use sqlquack_parse::tokenize;
use sqlquack_syntax::TokenKind;
use sqlquack_syntax::tokens::models::{Dialect, TokenType};
use sqlquack_syntax::tokens::models::{SourceLines, SourceLocation};
use sqlquack_tokenize::TokenKind;

use crate::snowflake::conversion::_helpers::support::tree::{
LITERAL_DATE, LITERAL_NUMBER, LITERAL_STRING, LITERAL_TIMESTAMP, node_kind,
Expand Down
11 changes: 11 additions & 0 deletions crates/sqlquack-diagnostics/src/classification/_helpers/clauses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ fn select_clauses(select: &Select) -> Vec<String> {
fetch,
distinct,
all: _,
distinct_span: _,
row_limit_span: _,
distinct_on,
top,
with,
Expand Down Expand Up @@ -87,6 +89,10 @@ fn select_clauses(select: &Select) -> Vec<String> {
span: _,
table_statement: _,
pipe_operators: _,
select_span: _,
list_head_span: _,
alias_spans: _,
item_spans: _,
} = select;
present(&[
(with.is_some(), "with"),
Expand Down Expand Up @@ -170,6 +176,8 @@ macro_rules! set_operation_clauses {
with_ties,
keyword: _,
span: _,
operator_span: _,
row_limit_span: _,
} = operation;
present(&[
(*all, concat!($prefix, "_all")),
Expand Down Expand Up @@ -210,6 +218,9 @@ set_operation_clauses!(except_clauses, Except, "except");

fn join_constructs(join: &Join) -> Vec<Construct> {
let Join {
kind_span: _,
keyword_span: _,
on_span: _,
this: _,
on: _,
using,
Expand Down
1 change: 1 addition & 0 deletions crates/sqlquack-fingerprint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ shared-tokenizer = []
sha2.workspace = true
sqlquack-parse.workspace = true
sqlquack-syntax.workspace = true
sqlquack-tokenize.workspace = true

[dev-dependencies]
# The tests fingerprint every dialect.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! `shared_texts`: the significant token texts of SQL under the shared lossless tokenizer.

use sqlquack_parse::tokenize;
use sqlquack_syntax::lossless::models::TokenKind;
use sqlquack_syntax::tokens::models::Dialect;
use sqlquack_tokenize::lossless::models::TokenKind;

use crate::fingerprint::errors::FingerprintError;

Expand Down
1 change: 1 addition & 0 deletions crates/sqlquack-format/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ native-scanner = []
serde_json.workspace = true
sqlquack-parse.workspace = true
sqlquack-syntax.workspace = true
sqlquack-tokenize.workspace = true

[dev-dependencies]
# The tests lay out every dialect.
Expand Down
3 changes: 2 additions & 1 deletion crates/sqlquack-format/src/dialects/main/shared_type.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//! `shared_type`: the type the shared tokenizer gives one token's text.

use sqlquack_parse::tokenize;
use sqlquack_syntax::Dialect;
use sqlquack_syntax::tokens::models::TokenType;
use sqlquack_syntax::{Dialect, TokenKind};
use sqlquack_tokenize::TokenKind;

/// The type the shared tokenizer, reading `dialect`, gives `text` when it reads it as exactly one token.
pub(crate) fn shared_type(text: &str, dialect: Dialect) -> Option<TokenType> {
Expand Down
2 changes: 1 addition & 1 deletion crates/sqlquack-format/src/format/_helpers/lexemes.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! The significant tokens and comments of SQL, read from the lossless tokenizer.

use sqlquack_parse::tokenize;
use sqlquack_syntax::TokenKind;
use sqlquack_syntax::tokens::models::TokenType;
use sqlquack_tokenize::TokenKind;

use crate::dialects::main::comment::comment;
use crate::dialects::main::is_unquoted_word::is_unquoted_word;
Expand Down
2 changes: 1 addition & 1 deletion crates/sqlquack-format/src/format/tests/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use serde_json::Value;
use sqlquack_parse::tokenize;
use sqlquack_syntax::TokenKind;
use sqlquack_tokenize::TokenKind;

use crate::dialects::main::profile::profile;
use crate::format::_helpers::lexemes::lex;
Expand Down
48 changes: 0 additions & 48 deletions crates/sqlquack-lint/Cargo.toml

This file was deleted.

3 changes: 0 additions & 3 deletions crates/sqlquack-lint/src/bigquery/mod.rs

This file was deleted.

4 changes: 0 additions & 4 deletions crates/sqlquack-lint/src/bigquery/profile/_helpers/mod.rs

This file was deleted.

13 changes: 0 additions & 13 deletions crates/sqlquack-lint/src/bigquery/profile/_helpers/strict.rs

This file was deleted.

22 changes: 0 additions & 22 deletions crates/sqlquack-lint/src/bigquery/profile/_helpers/tokenizer.rs

This file was deleted.

Loading
Loading