13 releases (8 stable)

Uses old Rust 2015

2.0.1 Oct 7, 2022
2.0.0-rc.1 Jul 22, 2022
1.4.1 Oct 11, 2019
1.4.0 Jan 21, 2019
0.99.0 Nov 28, 2017

#30 in Procedural macros

Download history 42909/week @ 2022-08-12 49322/week @ 2022-08-19 40583/week @ 2022-08-26 43775/week @ 2022-09-02 46938/week @ 2022-09-09 47364/week @ 2022-09-16 43794/week @ 2022-09-23 44792/week @ 2022-09-30 47999/week @ 2022-10-07 42777/week @ 2022-10-14 47209/week @ 2022-10-21 43628/week @ 2022-10-28 50278/week @ 2022-11-04 49851/week @ 2022-11-11 49304/week @ 2022-11-18 40621/week @ 2022-11-25

197,641 downloads per month
Used in 313 crates (5 directly)


3.5K SLoC

A safe, extensible ORM and Query Builder for Rust

Build Status Gitter Crates.io

API Documentation: latest releasemaster branch


Diesel gets rid of the boilerplate for database interaction and eliminates runtime errors without sacrificing performance. It takes full advantage of Rust's type system to create a low overhead query builder that "feels like Rust."

Supported databases:

  1. PostgreSQL
  2. MySQL
  3. SQLite

You can configure the database backend in Cargo.toml:

diesel = { version = "<version>", features = ["<postgres|mysql|sqlite>"] }

Getting Started

Find our extensive Getting Started tutorial at https://diesel.rs/guides/getting-started. Guides on more specific features are coming soon.

Getting help

If you run into problems, Diesel has a very active Gitter room. You can come ask for help at gitter.im/diesel-rs/diesel. For help with longer questions and discussion about the future of Diesel, open a discussion on GitHub Discussions.

Code of conduct

Anyone who interacts with Diesel in any space, including but not limited to this GitHub repository, must follow our code of conduct.


Licensed under either of these:


Before contributing, please read the contributors guide for useful information about setting up Diesel locally, coding style and common abbreviations.

Unless you explicitly state otherwise, any contribution you intentionally submit for inclusion in the work, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.


~15K SLoC