Diesel is a safe, extensible ORM and query builder for Rust. Created by Sage Griffin, Diesel’s defining feature is compile-time query validation: SQL queries are constructed via a strongly-typed builder that catches type mismatches and missing columns before your code runs.
It supports PostgreSQL, MySQL, and SQLite, and is the most popular ORM in the Rust ecosystem.
Safe, extensible ORM and query builder for Rust. Compile-time query validation, zero-cost abstractions.
✨ Features
Type-safe query builder. Bad joins, wrong types, missing columns caught by rustc.
PostgreSQL, MySQL, SQLite supported. Same query code, different storage backend.
diesel print-schema generates Rust schema from the database. Always in sync.
diesel migration CLI. Up/down SQL migrations, embeds for shipping binaries.
Query builder lowers to raw SQL at compile time. Runtime overhead is minimal.