finds.dev← search

// the find

transact-rs/sqlx

★ 17,136 · Rust · Apache-2.0 · updated Jun 2026

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

SQLx is the de facto async SQL library for Rust — no ORM, no query builder DSL, just raw SQL with compile-time verification against a real database. If you write Rust and touch a database, you will almost certainly end up here. The compile-time `query!` macro is the headline feature: it catches type mismatches and missing columns before your code ships.

The compile-time query checking is genuinely useful in practice — it's not a toy; the macro connects to your actual DB schema during `cargo build` and will fail if your SQL doesn't match. The pure-Rust Postgres and MySQL drivers (zero unsafe outside SQLite) mean you're not wrapping libpq and fighting its quirks. Runtime agnosticism (tokio, async-std, actix) is handled cleanly via feature flags rather than a hard dependency. The offline mode with `sqlx prepare` solves the real-world CI problem where you don't want a live DB in your build pipeline.

MSSQL support was dropped in 0.7 with no concrete timeline for return — if you're on SQL Server, you're stuck on old versions or looking elsewhere. The compile-time magic means slow incremental builds; the README's own workaround (setting `opt-level = 3` for sqlx-macros in dev profile) is a Band-Aid, not a fix. The `Any` driver abstraction that lets you swap databases at runtime only supports a narrow subset of types, so it's less useful than it sounds for anything beyond toy examples. Connection pool configuration options are present but the docs on tuning them for production workloads (pool size, acquire timeout, idle timeout interaction) are thin — you'll learn the hard way.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →