SQLx is a Rust SQL toolkit that provides async, pure Rust database access with compile-time checked queries and no domain-specific language requirement.
The tool addresses the need for type-safe database interactions in Rust without sacrificing performance or requiring a query DSL. It achieves this through compile-time query verification that catches errors before runtime, while maintaining a straightforward API that works directly with SQL. The crate supports PostgreSQL, MySQL, MariaDB, and SQLite, with pure Rust implementations for the PostgreSQL and MySQL drivers. It is built on async/await primitives for concurrent database operations and includes features like connection pooling, automatic statement caching, and row streaming for efficient data handling.
Projects should adopt this tool if they need reliable, type-checked database access in Rust without the overhead of a full ORM. It suits applications ranging from web services to data-intensive systems where compile-time guarantees matter. The tool works across different async runtimes and TLS backends, making it flexible for various deployment scenarios. SQLite support relies on the C library rather than a pure Rust implementation, which is a practical trade-off given SQLite's complexity.
The project maintains a substantial user base, with most open issues coming from adopters reporting real-world problems rather than from the core team. Maintainers respond to new issues and pull requests within a few days. Development work is concentrated on bug fixes and enhancements, with particular focus on PostgreSQL support.