🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite.
This report presents the forensic synthetic code analysis of launchbadge/sqlx, a Rust project with 17,307 GitHub stars. SynthScan v2.0 examined 123,821 lines of code across 605 source files, recording 477 pattern matches distributed across 7 syntactic categories. The overall adjusted score of 3.8 places this repository in the Likely human-written band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 477 distinct pattern matches across 7 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | sqlx-postgres/src/copy.rs | 21 | /// Issue a `COPY FROM STDIN` statement and transition the connection to streaming data | COMMENT |
| LOW | sqlx-postgres/src/copy.rs | 41 | /// | COMMENT |
| LOW | sqlx-postgres/src/copy.rs | 61 | ) -> Result<BoxStream<'c, Result<Bytes>>> { | COMMENT |
| LOW | sqlx-postgres/src/copy.rs | 81 | /// <https://www.postgresql.org/docs/current/sql-copy.html> | COMMENT |
| LOW | sqlx-postgres/src/copy.rs | 201 | .inner | COMMENT |
| LOW | sqlx-postgres/src/arguments.rs | 21 | // backtrack and update the prefixed-len, then write until the next patch offset | COMMENT |
| LOW | sqlx-postgres/src/statement.rs | 61 | // impl<'q> From<PgStatement<'q>> for crate::any::AnyStatement<'q> { | COMMENT |
| LOW | sqlx-postgres/src/statement.rs | 81 | // } | COMMENT |
| LOW | sqlx-postgres/src/type_info.rs | 21 | /// if one was constructed with [`Self::with_oid()`] and the other with [`Self::with_name()`] or | COMMENT |
| LOW | sqlx-postgres/src/type_info.rs | 201 | /// Returns the _kind_ (simple, array, enum, etc.) for this type. | COMMENT |
| LOW | sqlx-postgres/src/type_info.rs | 261 | Some("mac_address") | COMMENT |
| LOW | sqlx-postgres/src/type_info.rs | 281 | /// | COMMENT |
| LOW | sqlx-postgres/src/type_info.rs | 301 | /// // Will prevent SQLx from inferring `_foo` as an array type. | COMMENT |
| LOW | sqlx-postgres/src/type_info.rs | 321 | elem_name: elem_name.into(), | COMMENT |
| LOW | sqlx-postgres/src/advisory_lock.rs | 21 | /// | COMMENT |
| LOW | sqlx-postgres/src/advisory_lock.rs | 41 | key: PgAdvisoryLockKey, | COMMENT |
| LOW | sqlx-postgres/src/advisory_lock.rs | 61 | /// The keyspace designated by a single 64-bit integer. | COMMENT |
| LOW | sqlx-postgres/src/advisory_lock.rs | 81 | /// This means the lock is not actually released as soon as the guard is dropped. To ensure the | COMMENT |
| LOW | sqlx-postgres/src/advisory_lock.rs | 101 | /// [hkdf]: https://datatracker.ietf.org/doc/html/rfc5869 | COMMENT |
| LOW | sqlx-postgres/src/advisory_lock.rs | 121 | // | COMMENT |
| LOW | sqlx-postgres/src/advisory_lock.rs | 141 | // This is specified by RFC 5869 but not elaborated upon: | COMMENT |
| LOW | sqlx-postgres/src/advisory_lock.rs | 181 | // It has something to do with how lifetimes work on the `Acquire` trait, I couldn't | COMMENT |
| LOW | sqlx-postgres/src/advisory_lock.rs | 241 | /// A connection-like type is required to execute the call. Allowed types include `PgConnection`, | COMMENT |
| LOW | sqlx-postgres/src/advisory_lock.rs | 281 | COMMENT | |
| LOW | sqlx-postgres/src/bind_iter.rs | 21 | /// iterating over them again to encode. | COMMENT |
| LOW | sqlx-postgres/src/bind_iter.rs | 41 | /// birthdate: DateTime<Utc>, | COMMENT |
| LOW | sqlx-postgres/src/listener.rs | 81 | /// By default, when [`Pool::close()`] is called on the pool this listener is using | COMMENT |
| LOW | sqlx-postgres/src/listener.rs | 101 | COMMENT | |
| LOW | sqlx-postgres/src/listener.rs | 201 | /// | COMMENT |
| LOW | sqlx-postgres/src/listener.rs | 221 | /// // handle notification, do something interesting | COMMENT |
| LOW | sqlx-postgres/src/listener.rs | 241 | /// | COMMENT |
| LOW | sqlx-postgres/src/column.rs | 21 | } | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 121 | /// | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 141 | /// # Example | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 161 | COMMENT | |
| LOW | sqlx-postgres/src/options/mod.rs | 181 | /// # Example | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 201 | /// .database("postgres"); | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 221 | /// .ssl_mode(PgSslMode::Require); | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 241 | pub fn ssl_root_cert(mut self, cert: impl AsRef<Path>) -> Self { | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 261 | COMMENT | |
| LOW | sqlx-postgres/src/options/mod.rs | 281 | /// .ssl_client_cert_from_pem(CERT); | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 301 | self | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 321 | /// // Providing a CA certificate with less than VerifyCa is pointless | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 361 | /// ```rust | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 381 | /// cause floating-points to be rounded to that many fewer digits than normal (`-1` causes | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 401 | /// * [Postgres manual, 8.1.3: Numeric Types; Floating-point Types][8.1.3] | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 421 | self | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 481 | /// assert_eq!(options.get_host(), "127.0.0.1"); | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 501 | /// Get the socket path. | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 521 | /// let options = PgConnectOptions::new() | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 541 | } | COMMENT |
| LOW | sqlx-postgres/src/options/mod.rs | 561 | /// # use sqlx_postgres::PgConnectOptions; | COMMENT |
| LOW | sqlx-postgres/src/types/money.rs | 21 | /// Reading `MONEY` value in text format is not supported and will cause an error. | COMMENT |
| LOW | sqlx-postgres/src/types/money.rs | 41 | /// ``` | COMMENT |
| LOW | sqlx-postgres/src/types/money.rs | 81 | /// See the type-level docs for an explanation of `locale_frac_digits`. | COMMENT |
| LOW | sqlx-postgres/src/types/ltree.rs | 61 | impl Display for PgLTreeLabel { | COMMENT |
| LOW | sqlx-postgres/src/types/lquery.rs | 21 | UnexpectedCharacter, | COMMENT |
| LOW | sqlx-postgres/src/types/lquery.rs | 41 | /// Ideally, SQLx's Postgres driver should support falling back to text format for types | COMMENT |
| LOW | sqlx-postgres/src/types/mod.rs | 1 | //! Conversions between Rust and **Postgres** types. | COMMENT |
| LOW | sqlx-postgres/src/types/mod.rs | 21 | //! | [`PgLQuery`] | LQUERY | | COMMENT |
| 392 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | README.md | 337 | .bind("user@example.com") | CODE |
| LOW | README.md | 361 | .bind("user@example.com") | CODE |
| LOW | tests/sqlite/sqlite.rs | 1237 | sqlx::query("insert into foo(bar, baz) values (1234, 'Lorem ipsum'), (5678, 'dolor sit amet')") | CODE |
| LOW | tests/sqlite/sqlite.rs | 1237 | sqlx::query("insert into foo(bar, baz) values (1234, 'Lorem ipsum'), (5678, 'dolor sit amet')") | CODE |
| LOW | tests/sqlite/sqlite.rs | 1256 | assert_eq!(rows[0].1, "Lorem ipsum"); | CODE |
| LOW | tests/sqlite/sqlite.rs | 1259 | assert_eq!(rows[1].1, "dolor sit amet"); | CODE |
| LOW | tests/sqlite/sqlite.rs | 1274 | "insert into foo.foo(bar, baz) values (1234, 'Lorem ipsum'), (5678, 'dolor sit amet')", | CODE |
| LOW | tests/sqlite/sqlite.rs | 1274 | "insert into foo.foo(bar, baz) values (1234, 'Lorem ipsum'), (5678, 'dolor sit amet')", | CODE |
| LOW | tests/sqlite/sqlite.rs | 1299 | assert_eq!(rows[0].1, "Lorem ipsum"); | CODE |
| LOW | tests/sqlite/sqlite.rs | 1302 | assert_eq!(rows[1].1, "dolor sit amet"); | CODE |
| LOW | tests/mysql/mysql.rs | 629 | SET @myvar := 'test@test.com'; | CODE |
| LOW | tests/mysql/mysql.rs | 692 | VALUES (1, 'Hello, world!', 'Lorem ipsum dolor sit amet', X'01020304DEADBEEF'); | CODE |
| LOW | tests/mysql/mysql.rs | 692 | VALUES (1, 'Hello, world!', 'Lorem ipsum dolor sit amet', X'01020304DEADBEEF'); | CODE |
| LOW | tests/mysql/mysql.rs | 719 | "Lorem ipsum dolor sit amet" | CODE |
| LOW | tests/mysql/mysql.rs | 719 | "Lorem ipsum dolor sit amet" | CODE |
| LOW | examples/postgres/json/README.md | 28 | echo '{ "name": "John Doe", "age": 30 }' | cargo run -- add | CODE |
| LOW | examples/postgres/json/README.md | 34 | echo '{ "name": "Jane Doe", "age": 25, "array": ["string", true, 0] }' | cargo run -- add | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | sqlx-core/src/from_row.rs | 216 | /// If your database supports a JSON type, you can leverage `#[sqlx(json)]` | COMMENT |
| MEDIUM | sqlx-core/src/pool/options.rs | 15 | /// Essentially, because it's impossible to write generic bounds that describe a closure | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/x.py | 38 | def maybe_fetch_sqlite_extension(): | CODE |
| LOW | tests/x.py | 68 | def required_feature_for_test(test_name): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/x.py | 6 | CODE | |
| LOW | examples/x.py | 18 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | gen-changelog.sh | 86 | # Check if the entry already exists in the changelog or in our list of new authors. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/x.py | 93 | CODE |