rs-db-driver-mysql-sqlx 0.1.0
MySQL / MariaDB: sqlx (the driver, re-exported, with a runnable example)
Install
cargo add rs-db-driver-mysql-sqlx --registry rupm
In Ruststudio: Packages, search for rs-db-driver-mysql-sqlx, Install.
Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-23.
Versions
- 0.1.0 2026-11-23
README
# rs-db-driver-mysql-sqlx
MySQL / MariaDB - sqlx: async SQL toolkit with a connection pool
Add it with `rupm add rs-db-driver-mysql-sqlx` (or `cargo add rs-db-driver-mysql-sqlx --registry rupm`). The driver `sqlx` is re-exported as `rs_db_driver_mysql_sqlx::sqlx`.
Also serves: MariaDB, TiDB, PlanetScale, Amazon Aurora MySQL
This driver is async: your project also needs an async runtime, for example `cargo add tokio --features macros,rt-multi-thread`.
## Example
```rust
use sqlx::mysql::MySqlPoolOptions;
#[tokio::main]
async fn main() -> Result<(), sqlx::Error> {
let pool = MySqlPoolOptions::new().max_connections(5).connect("mysql://user:password@localhost:3306/mydb").await?;
let row: (i64,) = sqlx::query_as("SELECT 1").fetch_one(&pool).await?;
println!("the server answered {}", row.0);
Ok(())
}
```