A safe, extensible ORM and Query Builder for Rust
This report summarizes scanner evidence for diesel-rs/diesel, a Rust project with 14,203 GitHub stars. SynthScan examined 194,022 lines of code across 1312 source files, recording 1676 pattern matches distributed across 8 syntactic categories. The legacy adjusted pattern signal is 6.9 (Moderate pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 1661 finding(s).
Are imports declared and package/API names verified? 10 finding(s).
Are wrappers, guards, and repeated structures necessary? 6 finding(s).
Which changes need focused human review? 1676 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 1676 distinct pattern matches across 8 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | diesel_infer_query/src/query_source.rs | 1 | // This Source Code Form is subject to the terms of the Mozilla Public | COMMENT |
| LOW | diesel_infer_query/src/query_source.rs | 21 | /// This information is relevant to | COMMENT |
| LOW | diesel_infer_query/src/query_source.rs | 41 | /// source lookup map | COMMENT |
| LOW | diesel_infer_query/src/error.rs | 1 | // This Source Code Form is subject to the terms of the Mozilla Public | COMMENT |
| LOW | diesel_infer_query/src/views.rs | 21 | pub fn field_count(&self) -> usize { | COMMENT |
| LOW | .config/nextest.toml | 21 | # statements straddling a second boundary; | COMMENT |
| LOW | guide_drafts/trait_derives.md | 221 | } | COMMENT |
| LOW | diesel_compile_tests/tests/trybuild.rs | 21 | // would leak into the blessed `.stderr` files. Map the actual target | COMMENT |
| LOW | …ests/tests/fail/array_expressions_must_be_same_type.rs | 21 | //~^ ERROR: cannot select `f64` from `diesel::internal::table_macro::NoFromClause` | COMMENT |
| LOW | …ests/fail/right_side_of_left_join_requires_nullable.rs | 41 | let join = users::table.left_outer_join(posts::table); | COMMENT |
| LOW | …ests/fail/right_side_of_left_join_requires_nullable.rs | 141 | //~^ ERROR: type mismatch resolving `<table as AppearsInFromClause<table>>::Count == Never` | COMMENT |
| LOW | …select_for_update_cannot_be_mixed_with_some_clauses.rs | 21 | //~| ERROR: the trait bound `SelectStatement<_, _, _>: QueryRelation` is not satisfied | COMMENT |
| LOW | …select_for_update_cannot_be_mixed_with_some_clauses.rs | 41 | //~| ERROR: the trait bound `BoxedSelectStatement<'_, _, _, _>: QueryRelation` is not satisfied | COMMENT |
| LOW | …/cannot_mix_aggregate_and_non_aggregate_in_order_by.rs | 61 | // aggregate ORDER BY without explicit SELECT (default non-aggregate select, no GROUP BY) | COMMENT |
| LOW | …indow_functions_expression_requires_window_function.rs | 21 | users::table.select(lower(users::name).over()); | COMMENT |
| LOW | …indow_functions_expression_requires_window_function.rs | 41 | //~| ERROR: `diesel::sql_types::Text` is neither `diesel::sql_types::Range<_>` nor `diesel::sql_types::Multirange<_> | COMMENT |
| LOW | …ggregate_expression_requires_column_from_same_table.rs | 21 | let source = users::table.select(sum(posts::id)); | COMMENT |
| LOW | diesel_compile_tests/tests/fail/selectable.rs | 201 | .load(&mut conn) | COMMENT |
| LOW | …compile_tests/tests/fail/find_requires_correct_type.rs | 21 | //~^ ERROR: the trait bound `str: Expression` is not satisfied | COMMENT |
| LOW | …s/fail/derive/belongs_to_missing_foreign_key_column.rs | 21 | #[derive(Associations)] | COMMENT |
| LOW | …sts/tests/fail/derive/identifiable_missing_pk_field.rs | 21 | } | COMMENT |
| LOW | …esel_compile_tests/tests/fail/derive/bad_belongs_to.rs | 61 | #[diesel(belongs_to(Bar = "bar_id"))] | COMMENT |
| LOW | diesel_compile_tests/tests/fail/derive/empty_struct.rs | 21 | //~^ ERROR: this derive can only be used on non-unit structs | COMMENT |
| LOW | …l_compile_tests/tests/fail/derive/bad_postgres_type.rs | 21 | #[diesel(postgres_type(name))] | COMMENT |
| LOW | …l_compile_tests/tests/fail/derive/bad_postgres_type.rs | 41 | #[diesel(postgres_type(name = "foo", array_oid = 3))] | COMMENT |
| LOW | …l_compile_tests/tests/fail/derive/bad_postgres_type.rs | 61 | #[diesel(postgres_type(schema = "foo"))] | COMMENT |
| LOW | diesel_compile_tests/tests/fail/derive/bad_sql_type.rs | 1 | extern crate diesel; | COMMENT |
| LOW | …esel_compile_tests/tests/fail/derive/bad_mysql_type.rs | 21 | #[diesel(mysql_type(name))] | COMMENT |
| LOW | diesel_compile_tests/tests/fail/derive/has_query.rs | 41 | //~| ERROR: the trait bound `String: FromSqlRow<Integer, Sqlite>` is not satisfied | COMMENT |
| LOW | diesel_compile_tests/tests/fail/derive/has_query.rs | 61 | //~^ ERROR: the trait bound `SelectStatement<_, _, _, _>: SelectDsl<_>` is not satisfied | COMMENT |
| LOW | …sel_compile_tests/tests/fail/derive/bad_sqlite_type.rs | 21 | #[diesel(sqlite_type(name))] | COMMENT |
| LOW | …ts/fail/derive/belongs_to_missing_foreign_key_field.rs | 1 | #[macro_use] | COMMENT |
| LOW | …sel_compile_tests/tests/fail/derive/bad_column_name.rs | 21 | #[derive(Queryable)] | COMMENT |
| LOW | …tests/fail/derive_deprecated/deprecated_column_name.rs | 21 | #[derive(AsChangeset)] | COMMENT |
| LOW | …sts/fail/derive_deprecated/deprecated_postgres_type.rs | 21 | #[postgres(type_name)] | COMMENT |
| LOW | …sts/fail/derive_deprecated/deprecated_postgres_type.rs | 41 | #[postgres(type_name = "foo", array_oid = "3")] | COMMENT |
| LOW | …ts/tests/fail/derive_deprecated/deprecated_sql_type.rs | 1 | #[macro_use] | COMMENT |
| LOW | …/tests/fail/derive_deprecated/deprecated_belongs_to.rs | 21 | COMMENT | |
| LOW | …/tests/fail/derive_deprecated/deprecated_belongs_to.rs | 61 | #[derive(Associations)] | COMMENT |
| LOW | …/tests/fail/derive_deprecated/deprecated_belongs_to.rs | 101 | #[belongs_to(Bar, what)] | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 1 | //! This module provides a container that allows to receive a dynamically | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 21 | //! # | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 41 | //! # } | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 61 | //! # | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 81 | //! # use diesel::mariadb::{Mariadb, MariadbType}; | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 101 | //! | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 121 | //! name: "name".into(), | COMMENT |
| LOW | diesel_dynamic_schema/src/dynamic_value.rs | 141 | //! } | COMMENT |
| LOW | diesel_dynamic_schema/src/lib.rs | 1 | //! # Diesel dynamic schema | COMMENT |
| LOW | diesel_dynamic_schema/src/lib.rs | 21 | //! for actually exist, or that the types you state are correct. | COMMENT |
| LOW | diesel_dynamic_schema/src/lib.rs | 41 | //! # | COMMENT |
| LOW | diesel_dynamic_schema/src/lib.rs | 61 | //! # | COMMENT |
| LOW | diesel_dynamic_schema/src/lib.rs | 101 | pub use self::dynamic_select::DynamicSelectClause; | COMMENT |
| LOW | diesel_dynamic_schema/src/table.rs | 61 | /// let schema: Schema<&str> = "public".into(); | COMMENT |
| LOW | dsl_auto_type/src/auto_type/local_variables_map.rs | 121 | LetStatementInferredType { | COMMENT |
| LOW | diesel/src/data_types.rs | 1 | //! Structs to represent the primitive equivalent of SQL types where | COMMENT |
| LOW | diesel/src/util.rs | 21 | // a dummy map impl that provides | COMMENT |
| LOW | diesel/src/reexport_ambiguities.rs | 1 | // This macro exists to workaround | COMMENT |
| LOW | diesel/src/backend.rs | 21 | COMMENT | |
| LOW | diesel/src/backend.rs | 41 | /// Implementing support for a new backend is a complex topic and depends on the | COMMENT |
| 1592 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | .github/dependabot.yml | 3 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | COMMENT |
| MEDIUM | .github/dependabot.yml | 5 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | COMMENT |
| MEDIUM⚡ | .github/dependabot.yml | 31 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | COMMENT |
| MEDIUM⚡ | .github/dependabot.yml | 33 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | COMMENT |
| MEDIUM⚡ | .github/dependabot.yml | 41 | # ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | diesel/src/sqlite/connection/mod.rs | 584 | /// sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Doe', 'jane.doe@e | COMMENT |
| LOW | diesel/src/sqlite/connection/mod.rs | 584 | /// sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Doe', 'jane.doe@e | COMMENT |
| LOW⚡ | diesel/src/sqlite/connection/mod.rs | 1121 | "John Doe".to_string(), | CODE |
| LOW⚡ | diesel/src/sqlite/connection/mod.rs | 1126 | "Jane Doe".to_string(), | CODE |
| LOW⚡ | diesel/src/sqlite/connection/mod.rs | 1135 | let _ = crate::sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Do | CODE |
| LOW⚡ | diesel/src/sqlite/connection/mod.rs | 1135 | let _ = crate::sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Do | CODE |
| LOW | diesel/src/sqlite/connection/mod.rs | 1186 | let _ = crate::sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Do | CODE |
| LOW | diesel/src/sqlite/connection/mod.rs | 1186 | let _ = crate::sql_query("INSERT INTO users (name, email) VALUES ('John Doe', 'john.doe@example.com'), ('Jane Do | CODE |
| LOW | diesel/src/expression/mod.rs | 1048 | /// .select(selection(NameOrConst::Const("Jane Doe".into()))) | COMMENT |
| LOW | diesel/src/expression/mod.rs | 1050 | /// assert_eq!(String::from("Jane Doe"), with_name); | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | diesel/src/connection/statement_cache/mod.rs | 411 | /// Essentially a customized version of [`Cow`] | COMMENT |
| MEDIUM | diesel_derives/src/sql_function.rs | 1507 | /// Essentially the same as ArgCaptured, but only allowing ident patterns | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | diesel/src/query_source/aliasing/macros.rs | 5 | /// Example usage | COMMENT |
| LOW | diesel/src/expression/operators.rs | 210 | /// ## Example usage | COMMENT |
| LOW | diesel_derives/src/lib.rs | 1313 | /// Example usage | COMMENT |
| LOW | diesel_derives/src/lib.rs | 1616 | /// Example usage | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | .github/workflows/release.yml | 287 | # Create a GitHub Release while uploading all files to it | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | diesel/src/mysql_like/connection/stmt/mod.rs | 183 | // We're about to call `mysql_stmt_fetch` we need to check if our binds are still valid | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/sqlite/wasm/server.py | 5 | class RequestHandler(SimpleHTTPRequestHandler): | CODE |