On this page
Overview
Diesel is an ORM and query builder for Rust. It represents database schemas in Rust types and provides typed query construction, model loading and persistence, migrations, and raw SQL across PostgreSQL, MySQL, SQLite, and MariaDB backends.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Use schema and type information to catch query mismatches earlier
Diesel represents schemas through Rust constructs such as table! and combines them with typed query builders and model types. Selectable and backend checks can improve compiler errors when Rust fields do not match SQL-side expressions.
Best fit
Before adoption
Check Rust 1.86+, native database dependencies, and patch updates
The 2.3.13 workspace requires Rust 1.86.0. Depending on the backend, libpq, libmysqlclient, or libsqlite3 may be needed, while the CLI offers bundled features. Version 2.3.13 also fixes SQLite memory-safety issues and generated-schema code-injection risks, making current patch releases important within the 2.3 line.
Official sources
- [1]diesel-rs/diesel — GitHub repository(2026-10-06)
- [2]Diesel 2.3.13 — README(2026-10-06)
- [3]Diesel CLI 2.3.13 — README(2026-10-06)
- [4]Diesel 2.3.13 — crate documentation(2026-10-06)
- [5]Diesel 2.3.13 — workspace Cargo.toml(2026-10-06)
- [6]Diesel 2.3.13 release(2026-10-06)
Supplemental curator note
Diesel's strength is representing database schemas in Rust types so query mismatches can be caught earlier. Its CLI and database drivers also bring native-library requirements, so reproduce the same backend dependencies across development, CI, and containers.
Try it in 3 steps
- 1
Install Diesel CLI 2.3.13 with bundled SQLite
Pin the reviewed CLI version and build SQLite as a bundled dependency. Rust 1.86 or newer and a C compiler are required.
cargo install diesel_cli --version 2.3.13 --no-default-features --features "sqlite-bundled" - 2
Prepare the official SQLite example and run its migrations
Clone the official Getting Started SQLite example and apply its included migrations to test.db.
git clone --depth 1 --branch v2.3.13 https://github.com/diesel-rs/diesel.git && cd diesel/examples/sqlite/getting_started_step_3 && echo "DATABASE_URL=file:test.db" > .env && diesel migration run - 3
Run a typed query
Run the official show_posts binary and verify that the generated schema and Diesel query builder connect to SQLite successfully.
cargo run --bin show_posts
Growth
Growth trends · Last 30 days
14,193 Stars
Trend data is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- mysql
- orm
- postgresql
- query-builder
- rust
- sqlite
- Stars
- 14,193
- Forks
- 1,247
- Watchers
- 108
- Open issues
- 167
- Contributors
- 393
- Owner type
- Organization
- Primary language
- Rust
- License
- Apache-2.0
- Repository last updated
- Oct 5, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- MySQL Server12,441 Stars
4 shared tag(s) · 1 shared category(s)
Run relational workloads with InnoDB transactions, SQL, replication, and high-availability tooling
C++ - goose11,544 Stars
4 shared tag(s) · 1 shared category(s)
run SQL and Go-function schema migrations from a CLI or library
Go - Turso Database24,632 Stars
3 shared tag(s) · 2 shared category(s) · Same language
run SQLite-compatible SQL on a Rust database engine with bindings for multiple languages
Rust - redis-rs4,258 Stars
3 shared tag(s) · 2 shared category(s) · Same language
connect Rust applications to Redis and Valkey with synchronous or asynchronous clients
Rust - sqlc18,348 Stars
3 shared tag(s) · 2 shared category(s)
keep SQL as the source of truth and generate type-safe data-access code
Go - sqlx17,743 Stars
3 shared tag(s) · 2 shared category(s)
extend database/sql with struct scanning and named queries without replacing its interfaces
Go
Report incorrect information
Tell us if any listing information is incorrect or outdated.