The Rust SQL Toolkit
open sourceMIT OR Apache-2.0free
SQLx is an async, pure Rust SQL toolkit with compile-time checked queries and no DSL: you write plain SQL and, if you want, the query! macros check it against a real database while compiling. It isn't an ORM. It supports PostgreSQL, MySQL, MariaDB and SQLite (the Postgres and MySQL drivers use no unsafe code), runs on tokio, async-std or actix with native-tls or rustls, and includes connection pooling, row streaming, prepared statement caching, Postgres LISTEN/NOTIFY, nested transactions with savepoints and an Any driver chosen at runtime. The sqlx-cli tool manages migrations and prepares query data for offline builds. MSSQL support was removed in 0.7.
Problems it solves
- query Postgres from async Rust with plain SQL
- check my SQL queries against the database at compile time in Rust
- a Rust database library that isn't an ORM
- run database migrations for a Rust app
Features
- compile-time checked SQL
- async, runtime agnostic
- PostgreSQL, MySQL, MariaDB and SQLite
- connection pooling
- row streaming
- LISTEN/NOTIFY
- nested transactions
- migrations CLI
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what SQLx does.
- SeaORM A powerful relational ORM for Rust
