Skip to content
whichdevtool?
Categories ▾

Frameworks and UI

Frontend and full-stack frameworks Backend frameworks UI component libraries

Hosting

VPS and cloud servers App hosting and PaaS

Data

Managed databases File and object storage ORMs and database toolkits

AI

AI model APIs

Email

Transactional email APIs Email marketing and newsletters

Payments

Payments and billing

Domains and edge

Domain registrars CDN, DNS and edge security

Operations and identity

Monitoring, uptime and error tracking Auth and identity Background jobs, queues and workflows
Stacks Directory
Ctrl K

Search directory
Menu
StacksDirectory Pricing changes Glossary
VPS and cloud servers App hosting and PaaS Managed databases Transactional email APIs Email marketing and newsletters Domain registrars CDN, DNS and edge security Monitoring, uptime and error tracking Auth and identity Frontend and full-stack frameworks Backend frameworks UI component libraries AI model APIs File and object storage Payments and billing Background jobs, queues and workflows ORMs and database toolkits
  1. Home
  2. ORMs and database toolkits
  3. Diesel
Di

Compile-time checked Rust ORM and query builder · by Diesel (community project)

Diesel

Rust ORM and query builder that checks queries against your schema at compile time, with a CLI for migrations and schema generation; supports PostgreSQL, MySQL, MariaDB and SQLite.

Visit diesel.rs ↗ Alternatives Open source Open source Self-hostable
diesel.rs
Diesel homepage
§1

Overview

Diesel was started in 2015 and its most active maintainer today is GitHub user weiznich. Its central idea is that database interactions should be checked by the Rust compiler: diesel print-schema generates a schema.rs from your database, derives such as Queryable, Selectable and Insertable map structs to rows, and the query DSL rejects invalid column references or type mismatches before the program runs.

Migrations are plain up.sql and down.sql files managed with diesel_cli, which can also regenerate the schema after each migration. Raw SQL is supported through sql_query when the DSL does not cover a case.

Diesel 2.3, released on 12 September 2025 after 16 months of work by 95 contributors, added a HasQuery derive, window functions, SQLite in the browser via WebAssembly, JSON/JSONB for SQLite and many PostgreSQL range and array functions. The core crate is synchronous; the separate diesel-async crate provides async connections. Diesel suits teams that are willing to trade longer compile times and occasionally dense error messages for strong guarantees that queries match the schema.

§2

Pricing and plans

Plan Price What you get
Diesel $0 Dual-licensed: MIT or Apache 2.0

Free and open source; there is no paid product.

Source: github.com/diesel-rs/diesel · prices as published, excluding tax.

§3

What it does

Compile-time query checking
Queries are type-checked against schema.rs, so missing columns and type mismatches are compile errors.
diesel_cli
Creates and runs up/down SQL migrations and generates schema.rs from the database.
Derives
Queryable, Selectable, Insertable, AsChangeset and HasQuery remove row-mapping boilerplate.
Rich SQL DSL
Joins, subqueries, window functions, and PostgreSQL array, JSON and range operators.
SQLite on WASM
Since 2.3 the SQLite backend compiles to wasm32-unknown-unknown for browser use.
§4

Strengths and limitations

Strengths

  • Strongest compile-time guarantees among Rust database crates
  • Mature, with a long release history and a detailed guide
  • Low runtime overhead
  • Simple SQL-file migrations

Limitations

  • Core API is synchronous; async needs the separate diesel-async crate
  • Heavy use of generics produces long compile errors and can slow compilation
  • Supports only PostgreSQL, MySQL/MariaDB and SQLite
  • Minimum supported Rust version rises with releases (1.86 for 2.3)
§5

Who it suits

Good for

  • Rust backends that want queries verified at compile time
  • Teams comfortable with Rust's type system
  • CLI tools and apps using SQLite

Look elsewhere if

  • Fully async codebases that do not want an extra crate (SQLx or SeaORM)
  • Projects needing SQL Server or Oracle
§6

Pricing history

  • 12 Sept 2025

    Diesel 2.3 adds window functions and SQLite on WASM

    Diesel 2.3 added a HasQuery derive, window functions, browser SQLite via wasm32 and SQLite JSON support; minimum Rust version is 1.86. Source ↗

§7

Alternatives to Diesel

Tool From Free option Stages
Ky
Kysely Type-safe TypeScript SQL query builder
— Open source
Drizzle ORM SQL-like TypeScript ORM
— Open source
KJ
Knex.js JavaScript SQL query builder
— Open source
GO
GORM Full-featured Go ORM
— Open source
SO
SeaORM Async dynamic ORM for Rust
— Open source
Ec
Ecto Elixir data mapping and query toolkit
— Open source

All ORMs and database toolkits →

§8

Questions

Is Diesel async?

The core crate is synchronous; the separate diesel-async crate provides async connections for PostgreSQL and MySQL.

How does Diesel handle migrations?

diesel_cli manages up.sql and down.sql migration files and regenerates schema.rs from the database.

Diesel vs SQLx: which should I use?

Diesel offers a typed query DSL and ORM-style derives; SQLx checks hand-written SQL at compile time against a live database and is async-first.

Sources read for this page

  • https://diesel.rs/
  • https://github.com/diesel-rs/diesel
  • https://diesel.rs/news/2_3_0_release/
  • https://diesel.rs/changelog/version/diesel-2-3-0/
  • https://github.com/diesel-rs/diesel/releases/tag/v2.3.0
Spec sheet
From
Open source
Free tier
Free to self-host
Stages
HobbyIndieStartupScale-upEnterprise Suits hobby, indie, startup, scale-up
Language
Rust
Approach
ORM and query builder (compile-time checked)
Databases
PostgreSQL, MySQL, MariaDB, SQLite
Migrations
Yes, diesel_cli with up/down SQL files
Open source
Yes
Self-host
Yes
EU data
Not stated
Category
ORMs
Visit diesel.rs ↗

To report an out-of-date price or limit, use the correction form.

whichdevtool?

Developer and cloud tools compared on price, free tier and limits, each with its source. For side projects, solo developers and small teams.

Categories

  • VPS and cloud servers
  • App hosting and PaaS
  • Managed databases
  • Transactional email APIs
  • Email marketing and newsletters
  • Domain registrars
  • CDN, DNS and edge security
  • Monitoring, uptime and error tracking
  • Auth and identity
  • Frontend and full-stack frameworks
  • Backend frameworks
  • UI component libraries
  • AI model APIs
  • File and object storage
  • Payments and billing
  • Background jobs, queues and workflows
  • ORMs and database toolkits

Research

  • Directory
  • Stacks by project
  • Developer news
  • Pricing changes
  • Glossary

Site

  • About and methods
  • How we make money
  • Suggest a tool or fix
  • Privacy
© 2026 whichdevtool.com Prices change. Each tool page links to its source. We may earn a commission when you sign up through links on this site. How we make money