# diesel-rs/diesel

A safe, extensible ORM and Query Builder for Rust

Repository: https://github.com/diesel-rs/diesel
Canonical: https://ross.abutalabs.com/products/diesel
Homepage: https://diesel.rs
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: rust, query-builder, orm, postgresql, sqlite, mysql
Last push: 2026-08-25T17:12:13+00:00

## Health v2 (maintenance only)
Score: 94/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 84, longevity 100
- inputs: {"age_days": 4022, "days_push": 8, "days_rel": 26, "gap_med": 33.5, "n_releases_24m": 21}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 14162, forks 1232 (observed 2026-08-28T04:11:05.670311+00:00)

## What it is
Diesel is a safe, extensible ORM and query builder for Rust supporting PostgreSQL, MySQL, MariaDB, and SQLite. It leverages Rust's type system to catch incorrect database interactions at compile time while providing zero-cost abstractions for high-performance queries.

## Use cases
- query a postgres database from rust without writing raw sql
- build type-safe sql queries in rust
- map database rows to rust structs
- do crud operations with sqlite in a rust app
- avoid runtime sql errors by validating queries at compile time
- write complex sql queries with joins and filters in rust
- manage database migrations for a rust web service

## When to choose
- you want compile-time guarantees that your queries match your schema
- you need high-performance database access with zero-cost abstractions in Rust
- you want an ORM that supports PostgreSQL, MySQL, MariaDB, and SQLite
- you prefer writing queries in Rust rather than raw SQL strings

## When to avoid
- you need async database access out of the box (consider sea-orm or sqlx)
- you want a lightweight raw sql driver without an orm layer
- your project requires a database backend other than postgres, mysql, mariadb, or sqlite
- you need dynamic runtime-defined queries that cannot be checked at compile time

## Facets
- artifact type: library
- maturity: stable
- function: orm, database, database-driver, serialization
- domain: databases, backend, web-development, developer-tools
- platform: rust, cross-platform
- tags: query-builder, sql, postgresql, mysql, sqlite, mariadb, compile-time-checked, zero-cost-abstractions

## Member repositories
- diesel-rs/diesel (main) score 94

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:05.670311+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:12:46.409529+00:00, confidence not recorded.
  - readme: https://github.com/diesel-rs/diesel (fetched 2026-08-28T04:11:05.670311+00:00, sha 11face341541)
  - homepage: https://diesel.rs (fetched 2026-08-29T08:06:28.206194+00:00, sha 6c3541b9ed65)
  - site_page: https://diesel.rs/api_docs (fetched 2026-08-29T08:06:28.215451+00:00, sha 10cf2f277234)
  - site_page: https://diesel.rs/guides/getting-started (fetched 2026-08-29T08:06:28.218961+00:00, sha b168729f357d)
  - registry_crates: https://crates.io/api/v1/crates/diesel (fetched 2026-08-29T08:06:28.221354+00:00, sha 3f2e0b1f371c)
  - site_page: https://diesel.rs/changelog (fetched 2026-08-29T08:06:28.217162+00:00, sha a68a37c1597f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
