Registry / database / mysql-async

mysql-async

JSON →
library0.37.0rscratesunverified

Tokio based asynchronous MySql client library.

# Cargo.toml [dependencies] mysql_async = "0.37.0"
INSTALL
IMPORT
SIG · MYSQL-ASYNC
M
mysql-async
databaserustv0.37.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Pool
use mysql_async::Pool;

Connect to MySQL and run a query asynchronously

use mysql_async::Pool; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { let pool = Pool::new("mysql://user:pass@localhost/db"); let mut conn = pool.get_conn().await?; let result: Vec<(String,)> = conn.query("SELECT 'Hello'").await?; println!("{:?}", result); Ok(()) }
Debug
Known issues
gotchaRequires a Tokio runtime to execute async operations.
fix
Add `tokio` as a dependency and use `#[tokio::main]` or similar runtime.
affects: >=0.37.0
Upgrade
Version history
0.37.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
mysql-async — cargo add mysql-async · libregistry