🚀 Visit the Official Website & Documentation Hub 🚀
Built on top of sqlx and procedural macros, Rullst ORM brings the delightful, fluent syntax of Active Record frameworks (like Laravel's Eloquent) directly to the high-performance Rust ecosystem.
| Security Audit | Status | Description |
|---|---|---|
| OSSF Scorecard | Supply-chain security & best practices | |
| Codecov | Strict code coverage enforcement | |
| Matrix DB Tests | Dockerized PostgreSQL & MySQL integration tests | |
| OpenSSF | Open source security standards | |
| Property Testing | Validating complex logic against edge cases | |
| Miri UB Detection | Detecting Undefined Behavior and memory leaks | |
| Kani Verifier | Automated reasoning and formal verification | |
| CodeQL SAST | Advanced semantic code analysis | |
| Cargo Deny | Banning unmaintained/vulnerable crates | |
| Cargo Audit | Continuous scanning for crate vulnerabilities | |
| Cargo SemVer | Strict SemVer API breakage checks | |
| Cargo Machete | Detecting unused and bloated dependencies | |
| Continuous Fuzzing | Fuzzing against edge cases & panics | |
| Mutation Testing | Mutation testing for test suite robustness | |
| Unsafe Policy | 100% memory safe. No unsafe code blocks | |
| Panic Policy | Graceful error handling across the framework |
[!WARNING] Kani Verifier is currently configured to allow failures (
continue-on-error). It lacks upstream support for Rust 1.94+ (required bysqlx 0.9.0), so its badge may show as passing even if the pipeline was skipped or failed due to compiler incompatibility. Once Kani updates its compiler base, it will automatically run and pass again.
🚀 Why Rullst ORM?
In traditional Rust database handling, you have to write raw SQL queries, manage connection pools manually, and bind variables repetitively. Rullst ORM abstracts the heavy lifting behind a single #[derive(Orm)] macro, generating hundreds of safe, chainable query methods at compile time.
Key Features:
- Zero-Boilerplate CRUD: Insert, update, delete, and find records instantly.
- Fluent Query Builder: Chain
.where_eq(),.limit(), and.order_by()effortlessly. - Eager Loading: Solve N+1 problems with robust
has_many,belongs_to, andmorph_manyrelations. - Built-in Multi-Tenancy: Automatically scope all queries by tenant ID.
- Automated Audit Logs: Track
old_valuesandnew_valueshistory natively. - Scout Search: Seamlessly sync models to full-text search engines.
- Enterprise Ready: Read/write replica splitting, query chunking, and Redis caching built-in.
🛠️ Quick Start
Installation
Add the library to your Cargo.toml:
Zero-to-Hero Example
use ;
// 1. Just add the Orm macro to your struct!
async
📚 Documentation
The documentation is kept lean and straight to the point. Dive into the modules below to master Rullst ORM:
- 1. Basics & Query Builder: Connecting to the DB, filtering, sorting, and raw bindings.
- 2. Relationships: Has Many, Belongs To, Polymorphic relations, and Eager Loading.
- 3. Advanced Features: Multi-Tenancy, Audit Trails, Redis Caching, and Observers.
- 4. Migrations & Schema: Building tables programmatically and using the Artisan CLI.
- 5. Security & Testing: Execution order for Miri, Kani, Fuzzing, and Mutation tools.
🛡️ Security
Rullst ORM employs rigorous defenses against SQL Injection. All dynamic builder methods (like .where_eq()) automatically escape values using sqlx prepared statement bindings ($1 or ?). Raw queries (.where_raw()) actively force developers to provide an array of bindings directly in the function signature. Furthermore, all structural identifiers (table and column names) are validated strictly at runtime against a highly-optimized O(N) linear byte scan (zero regex overhead) to guarantee absolute SQL safety without sacrificing performance.
📄 License
This project is licensed under the MIT License.