Skip to content

feat: fields and lookups improvement by implementing auto-discovery for lookups and transforms and adding advanced JSON lookups.#38

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

Conversation

@Einswilli
Copy link
Copy Markdown
Contributor

Summary

This PR refactors the query engine for modularity and implements an auto-discovery system for lookups and transforms to improve developer experience.

Key Changes

  • Refactoring: Split lookup.rs and compiler.rs into modular directories for better maintainability.
  • Auto-Discovery: Implemented Rust-to-Python discovery of supported lookups/transforms, shifting validation to the Python Field layer for immediate and precise error reporting.
  • JSON Enhancements: Replaced has_keys with has_key, has_any, and has_all, with full support for PostgreSQL, MySQL, and SQLite.
  • Validation: Integrated field-level validation in QuerySet to catch unsupported filters before they reach the compiler.
  • Tests & Docs: Added comprehensive integration tests for JSON lookups and updated the filtering documentation.

Impact

Improved DX with early validation errors and enhanced JSON filtering capabilities across all supported backends.

Einswilli and others added 11 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.
@Einswilli Einswilli merged commit 78b8129 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