Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
09c5e61
refactor: build the DAG artifact natively
kvlonge Oct 12, 2026
e42d516
refactor: build compile inputs in the native compile driver
kvlonge Oct 12, 2026
c8fb288
refactor: read literal context SQL from Python functions natively
kvlonge Oct 12, 2026
9fcc2ff
refactor: locate Python UDF decorators natively
kvlonge Oct 12, 2026
15def3b
refactor: find renamed names in Python strings natively
kvlonge Oct 12, 2026
cb2a011
chore: update the Python boundary ratchet
kvlonge Oct 12, 2026
ce64c0a
refactor: discover project inputs in the native compile driver
kvlonge Oct 12, 2026
d2814fa
refactor: run the compile-and-plan pipeline in the native compile driver
kvlonge Oct 12, 2026
a8b6b5b
refactor: build the compile manifest natively
kvlonge Oct 12, 2026
dc13b85
refactor: compile projects through the native entry directly
kvlonge Oct 12, 2026
467a060
refactor: build discovery records natively
kvlonge Oct 12, 2026
4fb13b0
refactor: add native dialect and configured namespace helpers
kvlonge Oct 12, 2026
075fd79
refactor: assemble compiled projects in the native compile driver
kvlonge Oct 12, 2026
8bae6db
refactor: scan SQL quotes, comments and parentheses natively for refe…
kvlonge Oct 12, 2026
ede9ced
refactor: map uncataloged schema validation results natively
kvlonge Oct 12, 2026
eb233d0
refactor: delete unused SQL analysis entry points
kvlonge Oct 12, 2026
a1fda03
refactor: compute audit-gate and hook-read ordering edges natively
kvlonge Oct 12, 2026
84802f1
refactor: read the project lineage graph directly
kvlonge Oct 12, 2026
ab727d3
refactor: build fingerprint table SQL and decode latest fingerprint r…
kvlonge Oct 12, 2026
8ff1aaf
refactor: build project column lineage and its graph natively
kvlonge Oct 12, 2026
2aa95bd
refactor: render lineage trees and column payloads natively
kvlonge Oct 12, 2026
ae895b3
fix: raise the interpreter's own decoder error for invalid fingerprin…
kvlonge Oct 12, 2026
5c20c53
chore: update the Python boundary ratchet
kvlonge Oct 13, 2026
0998608
test: ignore phase durations when comparing launcher streams
kvlonge Oct 13, 2026
294f137
chore: drop duplicate boundary entries and a stale import check
kvlonge Oct 13, 2026
8042fa4
build: lint Rust with the CI toolchain in make check-ci
kvlonge Oct 13, 2026
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
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,9 @@
- An incremental rebuild after a focused change takes minutes. A build that is unexpectedly cold
or much slower than that is a signal to stop and investigate, not to wait or start over.
- Get fast feedback first: `cargo check -p <crate>` while editing, `cargo test -p <crate>` for
the crate you touched, then one maturin build and the focused Python tests. Run clippy with the
CI toolchain for the touched crates only.
the crate you touched, then one maturin build and the focused Python tests. CI lints with the
latest stable toolchain, so keep the local `stable` toolchain current (`rustup update stable`);
`make check-ci` includes `make rust-lint` (workspace clippy with `-D warnings`) before a push.
- Fix compiler errors by reading them and making the smallest correct change. Never delete and
rewrite a working module, or restart a port from scratch, because a build failed.
- Do not run two native builds against the same target directory at once, and do not run
Expand Down
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,15 @@ type:
dev-native:
uv run --no-sync maturin develop --profile dev --skip-install

rust-check:
cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
rust-check: rust-lint
uv run fensu check
cargo test --workspace --all-features

.PHONY: rust-lint
rust-lint:
cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features -- -D warnings


test:
@mkdir -p /tmp/opencode
Expand Down Expand Up @@ -604,7 +607,7 @@ verify-quick:
exit $$status


check-ci: check-e2e-shards check-native-layering check-python-boundary
check-ci: check-e2e-shards check-native-layering check-python-boundary rust-lint
uv run ruff format --check .
uv run ruff check .
uv run ty check src tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub mod finished_fact_models;
pub mod finished_model_facts;
pub mod model_reference_facts;
pub mod names_set_operation;
pub mod native_dialect;
pub mod projection_facts;
pub mod prove_dynamic_contracts;
pub mod prove_finished_dynamic_contracts;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//! The polyglot dialect name a project's SQL analysis dialect selects.

use crate::assembly::analysis_session::_helpers::mappings;

/// Python's `NATIVE_DIALECT_ALIASES.get(dialect or "", dialect)`.
pub fn native_dialect(dialect: Option<&str>) -> Option<&str> {
dialect.map(mappings::native_dialect)
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ mod helpers;
mod mappings;
#[path = "tests/test_model_columns.rs"]
mod model_columns;
#[path = "tests/test_native_dialect.rs"]
mod native_dialect;
#[path = "tests/test_reference_facts.rs"]
mod reference_facts;
#[path = "tests/test_types.rs"]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
use crate::assembly::analysis_session::main::native_dialect::native_dialect;
use crate::assembly::analysis_session::tests::test_types::NativeDialectTestCase;

#[test]
fn given_analysis_dialect_when_resolving_native_dialect_then_matches_python_aliases() {
let test_cases = [
NativeDialectTestCase {
description: "an aliased dialect maps to its polyglot name",
dialect: Some("postgres"),
expected_dialect: Some("postgresql"),
},
NativeDialectTestCase {
description: "an unaliased dialect is kept",
dialect: Some("snowflake"),
expected_dialect: Some("snowflake"),
},
NativeDialectTestCase {
description: "an empty dialect is kept",
dialect: Some(""),
expected_dialect: Some(""),
},
NativeDialectTestCase {
description: "no dialect stays absent",
dialect: None,
expected_dialect: None,
},
];

for test_case in test_cases {
let dialect = native_dialect(test_case.dialect);

assert_eq!(
dialect, test_case.expected_dialect,
"{}",
test_case.description
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,9 @@ pub(crate) struct ReferenceFactsTestCase {
pub(crate) expected_lineage: &'static [(&'static str, &'static str, &'static str)],
pub(crate) expected_required: &'static [&'static str],
}

pub(crate) struct NativeDialectTestCase {
pub(crate) description: &'static str,
pub(crate) dialect: Option<&'static str>,
pub(crate) expected_dialect: Option<&'static str>,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//! `_str_or_none`: a configured database or schema name, stripped, when it names one.

use sqlbuild_core::text::main::python_strip::python_strip;

/// Python's `value.strip() if value.strip() else None` for a string `value`.
pub fn configured_namespace(value: &str) -> Option<String> {
let stripped: &str = python_strip(value);
(!stripped.is_empty()).then(|| stripped.to_owned())
}
1 change: 1 addition & 0 deletions crates/sqlbuild-analysis/src/assembly/project/main/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pub mod assemble_project_resources;
pub mod check_sql_syntax;
pub mod configured_namespace;
pub mod environment_template_names;
pub mod preserved_logical_namespace;
pub mod sql_syntax_error;
2 changes: 2 additions & 0 deletions crates/sqlbuild-analysis/src/assembly/project/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#[path = "tests/test_configured_namespace.rs"]
mod configured_namespace;
#[path = "tests/test_environment_names.rs"]
mod environment_names;
#[path = "tests/helpers.rs"]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
use crate::assembly::project::main::configured_namespace::configured_namespace;
use crate::assembly::project::tests::test_types::ConfiguredNamespaceTestCase;

#[test]
fn given_configured_value_when_reading_namespace_then_matches_python_strip() {
let test_cases = [
ConfiguredNamespaceTestCase {
description: "surrounding whitespace is stripped",
value: " \tanalytics\n",
expected_namespace: Some("analytics"),
},
ConfiguredNamespaceTestCase {
description: "a blank value names no namespace",
value: " \u{3000}\u{1c} ",
expected_namespace: None,
},
ConfiguredNamespaceTestCase {
description: "an empty value names no namespace",
value: "",
expected_namespace: None,
},
ConfiguredNamespaceTestCase {
description: "inner whitespace is kept",
value: "\u{a0}sales data\u{2028}",
expected_namespace: Some("sales data"),
},
];

for test_case in test_cases {
let namespace = configured_namespace(test_case.value);

assert_eq!(
namespace.as_deref(),
test_case.expected_namespace,
"{}",
test_case.description
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,9 @@ pub(crate) struct EnvironmentNamesTestCase {
pub(crate) values: &'static [Option<&'static str>],
pub(crate) expected_names: &'static [&'static str],
}

pub(crate) struct ConfiguredNamespaceTestCase {
pub(crate) description: &'static str,
pub(crate) value: &'static str,
pub(crate) expected_namespace: Option<&'static str>,
}
Loading
Loading