Skip to content

Rullst ORMA beautiful, type-safe, Active Record ORM for Rust.

Built on top of SQLx, Rullst brings the delightful, fluent syntax of Active Record frameworks directly to the high-performance Rust ecosystem.

How it Works

1. Define your Model

Just add #[derive(Orm)] to your standard Rust structs. No external DSLs or massive configuration files required.

2. Compile-Time Magic

The macro parses your struct fields, relationships, and metadata, generating hundreds of safe, optimized, and chainable Active Record methods instantaneously.

3. Type-Safe Queries

Query your database using fluent syntax (e.g., .where_eq(), .limit()). All parameters are bound securely via sqlx to completely eliminate SQL Injection risks.

main.rs
rust
use rullst_orm::{Orm, FromRow};

#[derive(Debug, Clone, FromRow, Orm)]
pub struct User {
    pub id: i32,
    pub name: String,
    pub email: String,
}

#[tokio::main]
async fn main() -> Result<(), rullst_orm::Error> {
    Orm::init("sqlite::memory:").await?;

    // Fluent Queries
    let active_users = User::query()
        .where_like("email", "%@example.com")
        .order_by_desc("id")
        .limit(10)
        .get()
        .await?;

    Ok(())
}

Built with ❤️ for the Rust Community.