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
416 changes: 208 additions & 208 deletions Cargo.lock

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -228,24 +228,24 @@ sqlbuild-scopes = { path = "crates/sqlbuild-scopes" }
sqlbuild-sqltext = { path = "crates/sqlbuild-sqltext" }
sqlbuild-state = { path = "crates/sqlbuild-state" }
# SQL lint Rules, quality Rules and the formatter.
sqlclean = { git = "https://github.com/sqlstack-io/sqlclean.git", rev = "ac9aa4f4f8ef234d4bed3a80dc7e8c1ecac9b81a" }
# SQL change fingerprints over SQLQuack's tokenizers.
sqlquack-fingerprint = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "9d74b31a8d4cb14aa98d994345d3c90167646c75", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
sqlclean = { git = "https://github.com/sqlstack-io/sqlclean.git", rev = "1b54018c4561fbbba7c3dd057e56bdfab641c887" }
# SQL change fingerprints over SQLBabel's tokenizers.
sqlbabel-fingerprint = { git = "https://github.com/sqlstack-io/sqlbabel.git", rev = "b7b8acba57c0a81b173d328cf7e246a927a6dd93", features = ["bigquery", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
# Scopes, name resolution, types and lineage for the native analysis route.
sqlquack-semantics = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "9d74b31a8d4cb14aa98d994345d3c90167646c75", features = ["bigquery", "clickhouse", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
# SQLQuack's Snowflake-family parser and tokenizer, reached as SQLQuack exposes them.
sqlquack-parse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "9d74b31a8d4cb14aa98d994345d3c90167646c75" }
# SQLQuack's syntax tree and lossless tokens.
sqlquack-syntax = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "9d74b31a8d4cb14aa98d994345d3c90167646c75" }
# SQLQuack's tokenizer: lossless tokens and tokenize failures.
sqlquack-tokenize = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "9d74b31a8d4cb14aa98d994345d3c90167646c75" }
sqlquack-syntax-bigquery = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "9d74b31a8d4cb14aa98d994345d3c90167646c75" }
sqlquack-syntax-clickhouse = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "9d74b31a8d4cb14aa98d994345d3c90167646c75" }
sqlquack-syntax-databricks = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "9d74b31a8d4cb14aa98d994345d3c90167646c75" }
sqlquack-syntax-duckdb = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "9d74b31a8d4cb14aa98d994345d3c90167646c75" }
sqlquack-syntax-postgres = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "9d74b31a8d4cb14aa98d994345d3c90167646c75" }
sqlquack-syntax-sqlite = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "9d74b31a8d4cb14aa98d994345d3c90167646c75" }
sqlquack-syntax-sqlserver = { git = "https://github.com/sqlstack-io/sqlquack.git", rev = "9d74b31a8d4cb14aa98d994345d3c90167646c75" }
sqlbabel-semantics = { git = "https://github.com/sqlstack-io/sqlbabel.git", rev = "b7b8acba57c0a81b173d328cf7e246a927a6dd93", features = ["bigquery", "clickhouse", "databricks", "duckdb", "postgres", "snowflake", "sqlite", "sqlserver"] }
# SQLBabel's Snowflake-family parser and tokenizer, reached as SQLBabel exposes them.
sqlbabel-parse = { git = "https://github.com/sqlstack-io/sqlbabel.git", rev = "b7b8acba57c0a81b173d328cf7e246a927a6dd93" }
# SQLBabel's syntax tree and lossless tokens.
sqlbabel-syntax = { git = "https://github.com/sqlstack-io/sqlbabel.git", rev = "b7b8acba57c0a81b173d328cf7e246a927a6dd93" }
# SQLBabel's tokenizer: lossless tokens and tokenize failures.
sqlbabel-tokenize = { git = "https://github.com/sqlstack-io/sqlbabel.git", rev = "b7b8acba57c0a81b173d328cf7e246a927a6dd93" }
sqlbabel-syntax-bigquery = { git = "https://github.com/sqlstack-io/sqlbabel.git", rev = "b7b8acba57c0a81b173d328cf7e246a927a6dd93" }
sqlbabel-syntax-clickhouse = { git = "https://github.com/sqlstack-io/sqlbabel.git", rev = "b7b8acba57c0a81b173d328cf7e246a927a6dd93" }
sqlbabel-syntax-databricks = { git = "https://github.com/sqlstack-io/sqlbabel.git", rev = "b7b8acba57c0a81b173d328cf7e246a927a6dd93" }
sqlbabel-syntax-duckdb = { git = "https://github.com/sqlstack-io/sqlbabel.git", rev = "b7b8acba57c0a81b173d328cf7e246a927a6dd93" }
sqlbabel-syntax-postgres = { git = "https://github.com/sqlstack-io/sqlbabel.git", rev = "b7b8acba57c0a81b173d328cf7e246a927a6dd93" }
sqlbabel-syntax-sqlite = { git = "https://github.com/sqlstack-io/sqlbabel.git", rev = "b7b8acba57c0a81b173d328cf7e246a927a6dd93" }
sqlbabel-syntax-sqlserver = { git = "https://github.com/sqlstack-io/sqlbabel.git", rev = "b7b8acba57c0a81b173d328cf7e246a927a6dd93" }
stacker = "0.1"
# Counts heap allocations in growth tests, which measure work instead of time.
stats_alloc = "0.1"
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL := /bin/bash

.PHONY: verify verify-quick verify-pg coverage cli-preview rust-check check-native-layering check-parse-guard check-dupes-new check-native-stub check-build-features check-sqlload-release check-python-boundary check-release-gate check-docs-skill check-control-client \
.PHONY: verify verify-quick verify-pg coverage cli-preview rust-check check-native-layering check-parse-guard check-dupes-new check-native-stub check-build-features check-sqlload-release check-sqlbabel-pin check-python-boundary check-release-gate check-docs-skill check-control-client \
check-e2e-shards check-test-shards test-shard-core test-shard-publication test-shard-history \
test-e2e-duckdb test-e2e-duckdb-build-core \
test-e2e-duckdb-build-incremental \
Expand Down Expand Up @@ -760,7 +760,7 @@ verify-quick:
exit $$status


check-ci: check-dupes-new check-e2e-shards check-test-shards check-native-layering check-parse-guard check-native-stub check-build-features check-sqlload-release check-python-boundary check-release-gate check-docs-skill check-control-client rust-lint
check-ci: check-dupes-new check-e2e-shards check-test-shards check-native-layering check-parse-guard check-native-stub check-build-features check-sqlload-release check-sqlbabel-pin check-python-boundary check-release-gate check-docs-skill check-control-client rust-lint
uv run ruff format --check .
uv run ruff check .
uv run ty check src tests
Expand Down Expand Up @@ -791,6 +791,11 @@ check-build-features:
uv run python -m scripts.check_build_features


# SQLBabel's Rust crates build from the release tag of the Python package's pinned version.
check-sqlbabel-pin:
uv run python -m scripts.check_sqlbabel_pin


# A release links SQLLoad from crates.io only; a git pin is for unreleased work on a branch.
check-sqlload-release:
@if grep -Eq '^sqlload = .*git *=' Cargo.toml; then \
Expand Down
24 changes: 12 additions & 12 deletions crates/sqlbuild-analysis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ sqlbuild-model-config.workspace = true
sqlbuild-render.workspace = true
sqlbuild-scopes.workspace = true
sqlbuild-sqltext.workspace = true
sqlquack-fingerprint.workspace = true
sqlquack-parse.workspace = true
sqlquack-semantics.workspace = true
sqlquack-syntax.workspace = true
sqlquack-tokenize.workspace = true
sqlquack-syntax-bigquery.workspace = true
sqlquack-syntax-clickhouse.workspace = true
sqlquack-syntax-databricks.workspace = true
sqlquack-syntax-duckdb.workspace = true
sqlquack-syntax-postgres.workspace = true
sqlquack-syntax-sqlite.workspace = true
sqlquack-syntax-sqlserver.workspace = true
sqlbabel-fingerprint.workspace = true
sqlbabel-parse.workspace = true
sqlbabel-semantics.workspace = true
sqlbabel-syntax.workspace = true
sqlbabel-tokenize.workspace = true
sqlbabel-syntax-bigquery.workspace = true
sqlbabel-syntax-clickhouse.workspace = true
sqlbabel-syntax-databricks.workspace = true
sqlbabel-syntax-duckdb.workspace = true
sqlbabel-syntax-postgres.workspace = true
sqlbabel-syntax-sqlite.workspace = true
sqlbabel-syntax-sqlserver.workspace = true
stacker.workspace = true

[lints]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! The provided native analysis: sqlquack-semantics lineage and findings as SQLBuild's facts.
//! The provided native analysis: sqlbabel-semantics lineage and findings as SQLBuild's facts.

use sqlquack_semantics::dialects::types::DialectProfile;
use sqlquack_semantics::lineage::models::{
use sqlbabel_semantics::dialects::types::DialectProfile;
use sqlbabel_semantics::lineage::models::{
LineageContext, NameFinding, Nullability, OutputLineage, QueryLineage, SourceColumn,
TransformKind,
};
use sqlquack_semantics::statement_lineage_and_findings;
use sqlquack_syntax::Expression;
use sqlbabel_semantics::statement_lineage_and_findings;
use sqlbabel_syntax::Expression;

use crate::analysis_route::constants::{
ERROR_SEVERITY, UNKNOWN_COLUMN_CODE, UNKNOWN_FUNCTION_CODE,
Expand Down Expand Up @@ -208,7 +208,7 @@ fn diagnostic_row(
})
}

/// An unknown column's message with a quoted name as written, which SQLQuack quotes in lower case.
/// An unknown column's message with a quoted name as written, which SQLBabel quotes in lower case.
fn authored_message(finding: &NameFinding) -> String {
if finding.code != UNKNOWN_COLUMN_CODE || finding.written.is_empty() {
return finding.message.clone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::hash::{Hash, Hasher};
use rayon::ThreadPool;
use rayon::iter::{IntoParallelIterator, IntoParallelRefIterator, ParallelIterator};
use sha2::{Digest, Sha256};
use sqlbabel_semantics::lineage::models::SchemaColumn;
use sqlbuild_core::identifier_text::main::is_lowercase_identifier::is_lowercase_identifier;
use sqlquack_semantics::lineage::models::SchemaColumn;

use crate::analysis_route::_helpers::analysis::native_outcome::{
analysed_sql, native_outcome, native_sql,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::borrow::Cow;
use std::collections::HashMap;

use sqlquack_semantics::lineage::models::{Nullability, SchemaColumn};
use sqlbabel_semantics::lineage::models::{Nullability, SchemaColumn};

use crate::analysis_route::main::schema_column::schema_column;
use crate::analysis_route::models::{AnalysisInput, NativeAnalysis, ParserGap};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! BigQuery's native module: SQLQuack's GoogleSQL parser and the BigQuery semantics profile.
//! BigQuery's native module: SQLBabel's GoogleSQL parser and the BigQuery semantics profile.

use sqlquack_semantics::dialects::constants::BIGQUERY;
use sqlquack_semantics::dialects::types::DialectProfile;
use sqlquack_semantics::lineage::models::{NullabilityRule, SchemaColumn};
use sqlquack_semantics::lineage::types::LineageSchema;
use sqlquack_syntax::{DataType, Expression};
use sqlquack_syntax_bigquery::{Parsed, StrictFailure, parse_strict};
use sqlbabel_semantics::dialects::constants::BIGQUERY;
use sqlbabel_semantics::dialects::types::DialectProfile;
use sqlbabel_semantics::lineage::models::{NullabilityRule, SchemaColumn};
use sqlbabel_semantics::lineage::types::LineageSchema;
use sqlbabel_syntax::{DataType, Expression};
use sqlbabel_syntax_bigquery::{Parsed, StrictFailure, parse_strict};

use crate::analysis_route::_helpers::analysis::native_analysis::native_analysis;
use crate::analysis_route::_helpers::dialects::engine_types::bigquery_engine_type;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! ClickHouse's native module: SQLQuack's ClickHouse parser, profile and type spellings.
//! ClickHouse's native module: SQLBabel's ClickHouse parser, profile and type spellings.

use sqlquack_semantics::dialects::constants::CLICKHOUSE;
use sqlquack_semantics::dialects::types::DialectProfile;
use sqlquack_syntax::Parsed;
use sqlquack_syntax_clickhouse::parse_strict;
use sqlbabel_semantics::dialects::constants::CLICKHOUSE;
use sqlbabel_semantics::dialects::types::DialectProfile;
use sqlbabel_syntax::Parsed;
use sqlbabel_syntax_clickhouse::parse_strict;

use crate::analysis_route::_helpers::dialects::clickhouse_types::{
clickhouse_spelling, clickhouse_type, clickhouse_type_match,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Databricks' native module: SQLQuack's Databricks SQL parser and the Databricks semantics profile.
//! Databricks' native module: SQLBabel's Databricks SQL parser and the Databricks semantics profile.

use sqlquack_semantics::dialects::constants::DATABRICKS;
use sqlquack_semantics::dialects::types::DialectProfile;
use sqlquack_syntax::{DataType, Expression};
use sqlquack_syntax_databricks::{Parsed, StrictFailure, parse_strict};
use sqlbabel_semantics::dialects::constants::DATABRICKS;
use sqlbabel_semantics::dialects::types::DialectProfile;
use sqlbabel_syntax::{DataType, Expression};
use sqlbabel_syntax_databricks::{Parsed, StrictFailure, parse_strict};

use crate::analysis_route::_helpers::dialects::type_spelling::family_session_type;
use crate::analysis_route::constants::{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! DuckDB's native module: SQLQuack's native DuckDB parser reads its SQL. Validation only.
//! DuckDB's native module: SQLBabel's native DuckDB parser reads its SQL. Validation only.

use sqlquack_semantics::dialects::constants::DUCKDB;
use sqlquack_semantics::dialects::types::DialectProfile;
use sqlquack_syntax_duckdb::{Parsed, StrictFailure, parse_strict};
use sqlbabel_semantics::dialects::constants::DUCKDB;
use sqlbabel_semantics::dialects::types::DialectProfile;
use sqlbabel_syntax_duckdb::{Parsed, StrictFailure, parse_strict};

use crate::analysis_route::_helpers::dialects::engine_types::duckdb_engine_type;
use crate::analysis_route::_helpers::dialects::type_spelling::respelt;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! PostgreSQL's native module: SQLQuack's PostgreSQL 18 parser reads its SQL.
//! PostgreSQL's native module: SQLBabel's PostgreSQL 18 parser reads its SQL.

use sqlquack_semantics::dialects::constants::POSTGRES;
use sqlquack_semantics::dialects::types::DialectProfile;
use sqlquack_syntax_postgres::{Parsed, StrictFailure, format_type, parse_strict, parse_type};
use sqlbabel_semantics::dialects::constants::POSTGRES;
use sqlbabel_semantics::dialects::types::DialectProfile;
use sqlbabel_syntax_postgres::{Parsed, StrictFailure, format_type, parse_strict, parse_type};

use crate::analysis_route::constants::{
POSTGRES_DIALECT, POSTGRES_TEMPORAL_PRECISION, POSTGRES_TEMPORAL_SPELLINGS,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! Snowflake's native module: SQLQuack's Snowflake parser reads its SQL. Validation only.
//! Snowflake's native module: SQLBabel's Snowflake parser reads its SQL. Validation only.

use std::num::IntErrorKind;

use sqlquack_parse::{StrictFailure, parse_strict};
use sqlquack_semantics::dialects::constants::{SNOWFLAKE, SNOWFLAKE_QUOTED_IGNORING_CASE};
use sqlquack_semantics::dialects::types::DialectProfile;
use sqlquack_syntax::{Dialect, Error, Expression, Parsed};
use sqlquack_tokenize::TokenizeFailure;
use sqlbabel_parse::{StrictFailure, parse_strict};
use sqlbabel_semantics::dialects::constants::{SNOWFLAKE, SNOWFLAKE_QUOTED_IGNORING_CASE};
use sqlbabel_semantics::dialects::types::DialectProfile;
use sqlbabel_syntax::{Dialect, Error, Expression, Parsed};
use sqlbabel_tokenize::TokenizeFailure;

use crate::analysis_route::_helpers::dialects::engine_types::snowflake_engine_type;
use crate::analysis_route::_helpers::dialects::type_spelling::respelt;
Expand All @@ -16,7 +16,7 @@ use crate::analysis_route::constants::{
};
use crate::analysis_route::models::{AnalysisInput, ParserGap, SnowflakeDialect};
use crate::analysis_route::types::NativeDialect;
use crate::parse_guard::main::sqlquack_parse_options::sqlquack_parse_options;
use crate::parse_guard::main::sqlbabel_parse_options::sqlbabel_parse_options;
use crate::type_system::main::normalize_text_type::normalize_text_type;
use crate::type_system::models::{NormalizedType, PythonInteger, TypeDialect, TypeFamily};

Expand Down Expand Up @@ -101,7 +101,7 @@ fn snowflake_timestamp(spelling: &str) -> Option<Option<NormalizedType>> {

/// Every statement the shared parser reads from `sql`, or its first refusal, never marked syntax.
pub(crate) fn shared_parsed(sql: &str, dialect: Dialect) -> Result<Parsed, ParserGap> {
let statements: Vec<Expression> = parse_strict(sql, dialect, &sqlquack_parse_options())
let statements: Vec<Expression> = parse_strict(sql, dialect, &sqlbabel_parse_options())
.map_err(|failure| match failure {
StrictFailure::Tokens(
TokenizeFailure::Uncovered { start, .. } | TokenizeFailure::Overlap { start, .. },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! SQLite's native module: SQLQuack's native SQLite parser reads its SQL. Validation only.
//! SQLite's native module: SQLBabel's native SQLite parser reads its SQL. Validation only.

use sqlquack_semantics::dialects::constants::SQLITE;
use sqlquack_semantics::dialects::types::DialectProfile;
use sqlquack_syntax_sqlite::{Parsed, StrictFailure, parse_strict};
use sqlbabel_semantics::dialects::constants::SQLITE;
use sqlbabel_semantics::dialects::types::DialectProfile;
use sqlbabel_syntax_sqlite::{Parsed, StrictFailure, parse_strict};

use crate::analysis_route::_helpers::dialects::type_spelling::respelt;
use crate::analysis_route::constants::{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! SQL Server's native module: SQLQuack's T-SQL parser and its sqlquack-semantics profile.
//! SQL Server's native module: SQLBabel's T-SQL parser and its sqlbabel-semantics profile.

use sqlquack_semantics::dialects::constants::SQL_SERVER;
use sqlquack_semantics::dialects::types::DialectProfile;
use sqlquack_syntax::{DataType, Expression, Gap, Parsed};
use sqlquack_syntax_sqlserver::parse_strict;
use sqlbabel_semantics::dialects::constants::SQL_SERVER;
use sqlbabel_semantics::dialects::types::DialectProfile;
use sqlbabel_syntax::{DataType, Expression, Gap, Parsed};
use sqlbabel_syntax_sqlserver::parse_strict;

use crate::analysis_route::_helpers::dialects::engine_types::tsql_engine_type;
use crate::analysis_route::constants::{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

use std::collections::HashMap;

use sqlbabel_semantics::lineage::models::{Nullability, SchemaColumn};
use sqlbuild_sqltext::compiler::main::placeholder_defaults::placeholder_defaults;
use sqlbuild_sqltext::sql_scan::main::dialect_lexical_syntax::dialect_lexical_syntax;
use sqlquack_semantics::lineage::models::{Nullability, SchemaColumn};

use crate::analysis_route::_helpers::analysis::located_gap::{located, unreadable_reason};
use crate::analysis_route::_helpers::analysis::marker_names::{distinct_calls, first_call_names};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use sqlquack_semantics::lineage::models::{Nullability, SchemaColumn};
use sqlbabel_semantics::lineage::models::{Nullability, SchemaColumn};

use crate::assembly::analysis_session::constants::QUOTED_IDENTIFIER_DELIMITER;

/// A stored column name as SQLQuack reads it: `"…"` is quoted, its inner `""` one quote.
/// A stored column name as SQLBabel reads it: `"…"` is quoted, its inner `""` one quote.
#[must_use]
pub fn schema_column(
name: &str,
Expand Down
2 changes: 1 addition & 1 deletion crates/sqlbuild-analysis/src/analysis_route/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Which native module analyses a dialect's SQL over SQLQuack, if any does.
//! Which native module analyses a dialect's SQL over SQLBabel, if any does.

pub(crate) mod _helpers;
pub(crate) mod constants;
Expand Down
Loading
Loading