Repository Analysis

launchbadge/sqlx

🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite.

3.8 Likely human-written View on GitHub
3.8
Adjusted Score
3.8
Raw Score
100%
Time Factor
2026-05-26
Last Push
17,067
Stars
Rust
Language
123,771
Lines of Code
604
Files
477
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 0MEDIUM 2LOW 475

Pattern Findings

477 matches across 7 categories. Click a row to expand file-level details.

Over-Commented Block452 hits · 442 pts
SeverityFileLineSnippet
LOWsqlx-postgres/src/copy.rs21 /// Issue a `COPY FROM STDIN` statement and transition the connection to streaming data
LOWsqlx-postgres/src/copy.rs41 ///
LOWsqlx-postgres/src/copy.rs61 ) -> Result<BoxStream<'c, Result<Bytes>>> {
LOWsqlx-postgres/src/copy.rs81 /// <https://www.postgresql.org/docs/current/sql-copy.html>
LOWsqlx-postgres/src/copy.rs201 .inner
LOWsqlx-postgres/src/arguments.rs21// backtrack and update the prefixed-len, then write until the next patch offset
LOWsqlx-postgres/src/statement.rs61// impl<'q> From<PgStatement<'q>> for crate::any::AnyStatement<'q> {
LOWsqlx-postgres/src/statement.rs81// }
LOWsqlx-postgres/src/type_info.rs21/// if one was constructed with [`Self::with_oid()`] and the other with [`Self::with_name()`] or
LOWsqlx-postgres/src/type_info.rs201 /// Returns the _kind_ (simple, array, enum, etc.) for this type.
LOWsqlx-postgres/src/type_info.rs261 Some("mac_address")
LOWsqlx-postgres/src/type_info.rs281 ///
LOWsqlx-postgres/src/type_info.rs301 /// // Will prevent SQLx from inferring `_foo` as an array type.
LOWsqlx-postgres/src/type_info.rs321 elem_name: elem_name.into(),
LOWsqlx-postgres/src/advisory_lock.rs21///
LOWsqlx-postgres/src/advisory_lock.rs41 key: PgAdvisoryLockKey,
LOWsqlx-postgres/src/advisory_lock.rs61 /// The keyspace designated by a single 64-bit integer.
LOWsqlx-postgres/src/advisory_lock.rs81/// This means the lock is not actually released as soon as the guard is dropped. To ensure the
LOWsqlx-postgres/src/advisory_lock.rs101 /// [hkdf]: https://datatracker.ietf.org/doc/html/rfc5869
LOWsqlx-postgres/src/advisory_lock.rs121 //
LOWsqlx-postgres/src/advisory_lock.rs141 // This is specified by RFC 5869 but not elaborated upon:
LOWsqlx-postgres/src/advisory_lock.rs181 // It has something to do with how lifetimes work on the `Acquire` trait, I couldn't
LOWsqlx-postgres/src/advisory_lock.rs241 /// A connection-like type is required to execute the call. Allowed types include `PgConnection`,
LOWsqlx-postgres/src/advisory_lock.rs281
LOWsqlx-postgres/src/bind_iter.rs21/// iterating over them again to encode.
LOWsqlx-postgres/src/bind_iter.rs41/// birthdate: DateTime<Utc>,
LOWsqlx-postgres/src/listener.rs81 /// By default, when [`Pool::close()`] is called on the pool this listener is using
LOWsqlx-postgres/src/listener.rs101
LOWsqlx-postgres/src/listener.rs201 ///
LOWsqlx-postgres/src/listener.rs221 /// // handle notification, do something interesting
LOWsqlx-postgres/src/listener.rs241 ///
LOWsqlx-postgres/src/column.rs21}
LOWsqlx-postgres/src/options/mod.rs121 ///
LOWsqlx-postgres/src/options/mod.rs141 /// # Example
LOWsqlx-postgres/src/options/mod.rs161
LOWsqlx-postgres/src/options/mod.rs181 /// # Example
LOWsqlx-postgres/src/options/mod.rs201 /// .database("postgres");
LOWsqlx-postgres/src/options/mod.rs221 /// .ssl_mode(PgSslMode::Require);
LOWsqlx-postgres/src/options/mod.rs241 pub fn ssl_root_cert(mut self, cert: impl AsRef<Path>) -> Self {
LOWsqlx-postgres/src/options/mod.rs261
LOWsqlx-postgres/src/options/mod.rs281 /// .ssl_client_cert_from_pem(CERT);
LOWsqlx-postgres/src/options/mod.rs301 self
LOWsqlx-postgres/src/options/mod.rs321 /// // Providing a CA certificate with less than VerifyCa is pointless
LOWsqlx-postgres/src/options/mod.rs361 /// ```rust
LOWsqlx-postgres/src/options/mod.rs381 /// cause floating-points to be rounded to that many fewer digits than normal (`-1` causes
LOWsqlx-postgres/src/options/mod.rs401 /// * [Postgres manual, 8.1.3: Numeric Types; Floating-point Types][8.1.3]
LOWsqlx-postgres/src/options/mod.rs421 self
LOWsqlx-postgres/src/options/mod.rs481 /// assert_eq!(options.get_host(), "127.0.0.1");
LOWsqlx-postgres/src/options/mod.rs501 /// Get the socket path.
LOWsqlx-postgres/src/options/mod.rs521 /// let options = PgConnectOptions::new()
LOWsqlx-postgres/src/options/mod.rs541 }
LOWsqlx-postgres/src/options/mod.rs561 /// # use sqlx_postgres::PgConnectOptions;
LOWsqlx-postgres/src/types/money.rs21/// Reading `MONEY` value in text format is not supported and will cause an error.
LOWsqlx-postgres/src/types/money.rs41/// ```
LOWsqlx-postgres/src/types/money.rs81 /// See the type-level docs for an explanation of `locale_frac_digits`.
LOWsqlx-postgres/src/types/ltree.rs61impl Display for PgLTreeLabel {
LOWsqlx-postgres/src/types/lquery.rs21 UnexpectedCharacter,
LOWsqlx-postgres/src/types/lquery.rs41/// Ideally, SQLx's Postgres driver should support falling back to text format for types
LOWsqlx-postgres/src/types/mod.rs1//! Conversions between Rust and **Postgres** types.
LOWsqlx-postgres/src/types/mod.rs21//! | [`PgLQuery`] | LQUERY |
392 more matches not shown…
Fake / Example Data17 hits · 17 pts
SeverityFileLineSnippet
LOWREADME.md337 .bind("user@example.com")
LOWREADME.md361 .bind("user@example.com")
LOWtests/sqlite/sqlite.rs1237 sqlx::query("insert into foo(bar, baz) values (1234, 'Lorem ipsum'), (5678, 'dolor sit amet')")
LOWtests/sqlite/sqlite.rs1237 sqlx::query("insert into foo(bar, baz) values (1234, 'Lorem ipsum'), (5678, 'dolor sit amet')")
LOWtests/sqlite/sqlite.rs1256 assert_eq!(rows[0].1, "Lorem ipsum");
LOWtests/sqlite/sqlite.rs1259 assert_eq!(rows[1].1, "dolor sit amet");
LOWtests/sqlite/sqlite.rs1274 "insert into foo.foo(bar, baz) values (1234, 'Lorem ipsum'), (5678, 'dolor sit amet')",
LOWtests/sqlite/sqlite.rs1274 "insert into foo.foo(bar, baz) values (1234, 'Lorem ipsum'), (5678, 'dolor sit amet')",
LOWtests/sqlite/sqlite.rs1299 assert_eq!(rows[0].1, "Lorem ipsum");
LOWtests/sqlite/sqlite.rs1302 assert_eq!(rows[1].1, "dolor sit amet");
LOWtests/mysql/mysql.rs629 SET @myvar := 'test@test.com';
LOWtests/mysql/mysql.rs692 VALUES (1, 'Hello, world!', 'Lorem ipsum dolor sit amet', X'01020304DEADBEEF');
LOWtests/mysql/mysql.rs692 VALUES (1, 'Hello, world!', 'Lorem ipsum dolor sit amet', X'01020304DEADBEEF');
LOWtests/mysql/mysql.rs719 "Lorem ipsum dolor sit amet"
LOWtests/mysql/mysql.rs719 "Lorem ipsum dolor sit amet"
LOWexamples/postgres/json/README.md28echo '{ "name": "John Doe", "age": 30 }' | cargo run -- add
LOWexamples/postgres/json/README.md34echo '{ "name": "Jane Doe", "age": 25, "array": ["string", true, 0] }' | cargo run -- add
AI Slop Vocabulary2 hits · 6 pts
SeverityFileLineSnippet
MEDIUMsqlx-core/src/from_row.rs216/// If your database supports a JSON type, you can leverage `#[sqlx(json)]`
MEDIUMsqlx-core/src/pool/options.rs15/// Essentially, because it's impossible to write generic bounds that describe a closure
Hyper-Verbose Identifiers2 hits · 2 pts
SeverityFileLineSnippet
LOWtests/x.py38def maybe_fetch_sqlite_extension():
LOWtests/x.py68def required_feature_for_test(test_name):
Unused Imports2 hits · 2 pts
SeverityFileLineSnippet
LOWtests/x.py6
LOWexamples/x.py18
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippet
LOWgen-changelog.sh86 # Check if the entry already exists in the changelog or in our list of new authors.
Deep Nesting1 hit · 1 pts
SeverityFileLineSnippet
LOWtests/x.py93