You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 799db35
Browse filesBrowse the repository at this point in the historyBrowse files
* feat(native): add the native declaration scope crate
The new sqlbuild-scopes crate projects the scope builder's walked
resources and declarations into the static scope index with the Python
builder's record orders, duplicate and naming diagnostics and macro
dependency usages, the lookup's canonical orders and repr-ordered
groups, declaration visibility and the expected-model and tested-macro
relationship grants. Any path Python would reject defers the stage.
* feat(native): resolve declaration scopes natively behind the compiler engine switch
With the native engine, the scope index, its validation, relationship
grants and the scope lookup are built by sqlbuild-scopes and
materialised as the same Python records, orders and mappings. Python
keeps the relationship-name extraction and every error message: an
invalid index or a relationship fault raises exactly as before, and a
project the native index cannot reproduce runs the Python stage. sqb
scope uses the same path. The Python engine is unchanged.
* feat(native): compare declaration scopes in the compiler differential
The failure corpus gains scope cases: a duplicate scoped declaration,
inaccessible local and scoped declarations, the first of two visibility
errors, a test outside its relationship grants and a malformed expected
model. A harness test compares a scoped project with expected-model and
macro-test grants under both engines.
* refactor(native): group the Python bindings by domain
Move the PyO3 binding helpers into per-domain folders (analysis, boundary, discovery, rules, scopes, sqltext) and split the flat function module along the same lines. Function bodies are unchanged; only module paths and registration move.
* feat(native): add a native-preview compiler engine tier
Each native stage declares a shipped or preview tier in one registry. The native engine runs shipped stages only (discovery); native-preview adds stages still in development (declaration scopes). Preview keeps its own compiler, Rules and reuse stores. The per-PR differential compares python with native-preview on the full corpus and python with native on the seeds and failure corpus.
* feat(native): scan SQL tests natively for expected-model relationships
Under native-preview the declaration scope reads each model-mode SQL test's and scenario's __expected__<model> names with a native port of the Python top-level CTE scan, using the adapter's lexical rules. Any text Python would reject, or a non-ASCII character at a code position, defers that body to the Python extraction, so names and fault messages stay byte-identical.
* ci: cover the shipped engine in the dense differential and gate on the Python version job
Copy file name to clipboardExpand all lines: crates/README.md
+28-4Lines changed: 28 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ that can be tested and benchmarked with `cargo test` alone.
10
10
|`sqlbuild-sqltext`| Lexical SQL text without polyglot: comment, quote and parenthesis scanning, the rules quote policy, model header tokenization and matching, static variable substitution and static reference extraction. |
11
11
|`sqlbuild-config`| Configuration file reading without Python: `tomllib`-compatible TOML, PyYAML `safe_load`-compatible YAML 1.1, and typed project and local config readers for the fields discovery needs. Any error means "defer to Python", which re-parses for exact messages. |
12
12
|`sqlbuild-discovery`| Native project discovery: the shared directory walk with Python's glob and sort semantics, file reading with Python's newline handling, and parsing of authored files with Python's exact discovery messages. Results are plain data the Python discovery facade materialises; anything it cannot reproduce exactly defers to Python. |
13
+
|`sqlbuild-scopes`| Declaration scopes: the scope index with Python's record orders and diagnostics, declaration visibility, relationship grants, the scope lookup groups, and the dialect-aware scan of SQL tests and scenarios for their expected models. Anything it cannot reproduce exactly defers to Python. |
13
14
|`sqlbuild-analysis`| SQL analysis over polyglot: SQL tokens, query analysis, the binding catalog, semantic validation and usage, column references, and SQL-test extraction, planning and rendering. |
14
15
|`sqlbuild-rules`| Built-in rules and the rules engine, the custom-rule host, SQL lint, quality checks and formatting, rules configuration and the request models. It also owns the build identity script. |
15
16
|`sqlbuild-python`| The only PyO3 crate: the `_native` module, its Python classes and functions, conversions from Python objects, and the process allocator. |
@@ -20,13 +21,14 @@ Dependencies point one way, from the top of this graph to the bottom:
0 commit comments