CodeVetter · Repo Unpack · System map
diesel-rs/diesel
The workspace separates typed query execution, code generation, database tooling, and migration management into cooperating crates. Applications link Diesel directly, while the diesel executable supplies operational commands. Backend features select native drivers and dialect implementations, with additional SQLite platform support. Distribution and developer verification are implemented through cargo-dist, xtask, and GitHub Actions.
- The root workspace includes diesel, diesel_cli, diesel_derives, diesel_migrations, diesel_dynamic_schema, diesel_infer_query, parser crates, examples, and xtask; its shared baseline is Rust 1.88.0 and edition 2024.
- The actual diesel and diesel_cli package versions are 2.3.13; the CLI manifest declares the diesel binary at src/main.rs.
- diesel/src/lib.rs exposes associations, expressions, query_builder, query_dsl, serialization, rows, migrations, and feature-gated backend modules; query construction and driver execution are separate module boundaries.
- diesel_derives is a procedural-macro crate depending on shared attribute/table parsers and dsl_auto_type; diesel_attribute_parser explicitly identifies itself as internal.
- Backend features connect PostgreSQL through pq-sys, MySQL/MariaDB through mysqlclient-sys, and SQLite through target-specific libsqlite3-sys or sqlite-wasm-rs dependencies.
- PgConnection owns a statement cache, PostgreSQL metadata cache, raw connection, transaction state, and instrumentation; persisted migration versions belong to __diesel_schema_migrations in the database.
- cargo xtask is a Cargo alias for the xtask package, whose commands include run-tests, clippy, tidy, and semver-checks; CONTRIBUTING.md directs contributors to run-tests and tidy.
- cargo-dist targets five macOS/Linux/Windows architectures with shell and PowerShell installers, bundled CLI dependencies, SBOMs, and attestations; release publication is gated by the workflow's publishing output.