refactor: decouple core from PyO3, introduce ryx-rs native API, and expand type system#59
Merged
Merged
Conversation
…ormance optimizations - Reflect the new Rust workspace (ryx-core, ryx-backend, ryx-query, ryx-python) - Add 'Performance Philosophy' section describing Enum Dispatch and Zero-Allocation Rows - Update CONTRIBUTING.md with new build process and coding conventions - Create docs/doc/internals/performance.mdx for deep dive on optimizations
The test files have been relocated to the new workspace structure within the ryx-python crate (ryx-python/tests/).
- Refactor fields, models, queryset and migrations - Update backend Rust code (MySQL/SQLite) - Add benchmark for query compiler - Fix compiler module declaration (compiler.rs -> compilr.rs)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here is a professional and structured Pull Request title and description in English, summarizing all the architectural ## Overview
This PR represents a major architectural milestone for Ryx. We have successfully decoupled the core ORM logic from the Python bindings (
pyo3), paving the way for a fully native Rust ORM experience while preserving the performance and correctness of the Python API.Additionally, we've introduced
ryx-rs(the native Rust Django-style API) andryx-macrofor clean model declarations, expanded our SQL type-casting system, and updated our documentation to reflect these changes.Key Changes
1. Architectural Decoupling & Modularization
ryx-common: Houses shared types likeRyxError,PoolConfig,ModelMeta, andFieldMeta. This removes any direct dependencies onpyo3orryx-corefrom our fundamental layers.ryx-rs: A pure, native Rust implementation of the Django-style ORM API.ryx-macro: Contains macro definitions such as#[model]and#[relation]to dramatically simplify model declaration in Rust.ryx-core: Stripped down to act purely as a PyO3 bridge between Rust and Python.ryx-backendto makeryx-coreoptional via apythonfeature flag, making the backend completely usable in pure Rust environments.2. Expanded SQL Type System & Support
SqlValueVariants: ExpandedSqlValueto support specialized types:Date,DateTime,Time,Uuid,Decimal, andJson.err_to_py/IntoPyResult) andsql_to_pyconversions inryx-pythonto properly handle these types across the PyO3 boundary.3. Advanced Query Features in Rust (
select_related)FromRowtrait to support nested decoding viafrom_row_joinedandfrom_row_prefixed.QueryNodeand the SQL compiler to handle column-aliasing viaextra_aliases.select_relatedinryx-rs'sQuerySet, enabling single-queryLEFT JOINs that automatically hydrate related nested structs.4. Tests, Benchmarks, & CI
ryx-rs/tests/relation_test.rs.ryx-backend/benches/..github/workflows/ci.ymland updated the release workflow.5. Documentation Overhaul
README.mdto highlight both Python and Rust quick-start examples, key features, and visual architecture.docs/doc/rust/) detailing installation, CRUD, filtering, relationships, caching, and migrations.How to Test
cargo test --workspace