A lightweight ORM for Rust that combines ease of use with Rust's safety guarantees.
- Fluent API — Expressive, chainable query building
- Derive-based — Models and factories generated from struct definitions
- Factory support — Test data generation with relationship handling
use fabrique::prelude::*;
#[derive(Model, Factory)]
pub struct Product {
#[fabrique(primary_key)]
pub id: Uuid,
pub name: String,
pub price_cents: i32,
}
// Query
let products = Product::query()
.select()
.r#where(Product::PRICE_CENTS, ">=", 1000)
.get(&pool)
.await?;
// Create test data
let product = Product::factory()
.name("Anvil 3000".to_string())
.create(&pool)
.await?;- User Guide — Tutorials, concepts, and how-to guides
- API Reference — Technical documentation on docs.rs
MIT License