SQLx – The Rust SQL Toolkit
9 months ago
- #Async
- #SQL
- #Rust
- SQLx is an async, pure Rust SQL crate with compile-time checked queries.
- Supports PostgreSQL, MySQL, MariaDB, SQLite (MSSQL support removed in 0.7).
- Truly asynchronous, built using async/await for maximum concurrency.
- Database agnostic with runtime agnostic support (async-std, tokio, actix).
- Pure Rust drivers for Postgres and MySQL/MariaDB with zero unsafe code.
- Cross-platform compatibility, works anywhere Rust is supported.
- Built-in connection pooling with `sqlx::Pool`.
- Row streaming for asynchronous data reading and decoding.
- Automatic statement preparation and caching for high-level queries.
- Supports TLS for MySQL, MariaDB, and PostgreSQL.
- Asynchronous notifications with `LISTEN` and `NOTIFY` for PostgreSQL.
- Nested transactions with save points support.
- Any database driver for runtime database switching.
- Offline mode enabled for compile-time query verification without a DB.
- Example usage provided for connection pooling and query execution.
- Supports both prepared and unprepared queries.
- High-level query interface with fetch, fetch_one, fetch_optional, fetch_all.
- `query!` and `query_as!` macros for compile-time SQL verification.
- Licensed under Apache 2.0 or MIT.