Skip to content

Conversation

@benfdking
Copy link
Collaborator

Summary

This PR internalizes the sqruff-sqlinference external crate as a new sqlinference module within quary-core. All references to the external crate have been updated to use the internal module instead.

Key Changes

  • Removed external dependency: Removed sqruff-sqlinference (v0.34.1) from workspace dependencies and all crate manifests (cli, core, databases, wasm-binding)
  • Created internal module: Added new rust/core/src/sqlinference/ module with the following submodules:
    • mod.rs - Module entry point with SQL parsing utilities
    • test.rs - Test type definitions (NotNull, Unique, Relationship, AcceptedValues, comparison tests)
    • aggregate_functions.rs - Aggregate function behavior and test inferrability logic
    • columns.rs - Column extraction from SQL SELECT statements
    • infer_tests.rs - Test inference logic from SQL queries
    • inference.rs - Test runner action determination (Run/Skip with reasons)
  • Updated imports: Changed all references from sqlinference:: to crate::sqlinference:: across:
    • rust/core/src/lib.rs - Added module declaration
    • rust/core/src/description_table.rs
    • rust/core/src/project.rs
    • rust/core/src/rpc_proto_defined_functions.rs
    • rust/core/src/sql_inference_translator.rs
    • rust/core/src/tests.rs
    • rust/wasm-binding/src/rpc_proto_defined_functions.rs

Implementation Details

  • The internalized module maintains the same public API as the external crate
  • All test inference logic, aggregate function handling, and column extraction functionality is now part of the core library
  • This change reduces external dependencies and allows for tighter integration with the core library

https://claude.ai/code/session_01PrksUCESEqgJJL5Bu1d2uH

…dependency

Move the sqruff-sqlinference crate's functionality (test types, test
inference, column extraction, aggregate function analysis) directly into
quary-core as the `sqlinference` module. This consolidates lineage and
test inference logic that is quary-specific into the quary codebase
itself, removing the external dependency on sqruff-sqlinference while
retaining sqruff-lib-core and sqruff-lib-dialects for SQL parsing.

- Created `rust/core/src/sqlinference/` module with: mod.rs, test.rs,
  infer_tests.rs, inference.rs, columns.rs, aggregate_functions.rs
- Updated all imports across quary-core, wasm-binding to use the
  internal module
- Removed sqlinference dependency from workspace and all crate
  Cargo.toml files (workspace root, core, cli, wasm-binding,
  quary-databases)
- All 180 unit tests + 4 doctests + 22 wasm-binding tests pass

https://claude.ai/code/session_01PrksUCESEqgJJL5Bu1d2uH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants