Skip to content

refactor: extract query engine to standalone ryx-query crate#39

Merged
Einswilli merged 15 commits intoAllDotPy:masterfrom
Einswilli:fields_lookups
Apr 8, 2026
Merged

refactor: extract query engine to standalone ryx-query crate#39
Einswilli merged 15 commits intoAllDotPy:masterfrom
Einswilli:fields_lookups

Conversation

@Einswilli
Copy link
Copy Markdown
Contributor

This PR modularizes the query engine by extracting it into a standalone crate (ryx-query), decoupling the SQL compilation logic from PyO3 dependencies.

Key Changes:

  • Modularization: Moved the AST, compiler, and lookup registry into the ryx-query crate.
  • Performance & Benchmarking: Integrated criterion benchmarks to measure compilation speed, confirming high efficiency (sub-microsecond for simple queries).
  • Error Handling: Introduced a decoupled error system (QueryError $\rightarrow$ RyxError) for better clarity and seamless conversion to Python exceptions.
  • Maintainability: Simplified the main crate's structure and updated project versions.

Einswilli and others added 15 commits April 7, 2026 17:18
Split monolithic files into modular structure for better maintainability:

- src/query/lookups/:
  - lookups.rs: Core types, registry, resolve() logic
  - common_lookups.rs: Comparison/string lookups (exact, gt, contains, etc.)
  - date_lookups.rs: Date/time transforms (year, month, day, hour, etc.)
  - json_lookups.rs: JSON transforms and lookups (key, has_key, etc.)
  - mod.rs: Re-exports

- src/query/compiler/:
  - compiler.rs: Main SQL compiler implementation
  - helpers.rs: Internal helpers (quote_col, qualified_col, etc.)
  - mod.rs: Re-exports

All 241 tests pass. No functional changes.
Remove the pub use re-exports of all_lookups and all_transforms from the lookups module to narrow the public API surface. These symbols are no longer exported from ryx-query::lookups.
@Einswilli Einswilli merged commit 6987a10 into AllDotPy:master Apr 8, 2026
3 of 4 checks passed
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.

1 participant