Packages / rupm

rs-db-driver-mysql-mysql_async 0.1.0

MySQL / MariaDB: mysql_async (the driver, re-exported, with a runnable example)

Install

cargo add rs-db-driver-mysql-mysql_async --registry rupm

In Ruststudio: Packages, search for rs-db-driver-mysql-mysql_async, Install.

Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-23.

Versions

README

# rs-db-driver-mysql-mysql_async

MySQL / MariaDB - mysql_async: async driver

Add it with `rupm add rs-db-driver-mysql-mysql_async` (or `cargo add rs-db-driver-mysql-mysql_async --registry rupm`). The driver `mysql_async` is re-exported as `rs_db_driver_mysql_mysql_async::mysql_async`.

Also serves: MariaDB, TiDB, PlanetScale

This driver is async: your project also needs an async runtime, for example `cargo add tokio --features macros,rt-multi-thread`.

## Example

```rust
use mysql_async::prelude::*;

#[tokio::main]
async fn main() -> Result<(), mysql_async::Error> {
    let pool = mysql_async::Pool::new("mysql://user:password@localhost:3306/mydb");
    let mut conn = pool.get_conn().await?;
    let n: Option<u32> = conn.query_first("SELECT 1").await?;
    println!("the server answered {n:?}");
    drop(conn);
    pool.disconnect().await?;
    Ok(())
}
```