Merge branch 'Freax13-fetch-one-hang'

This commit is contained in:
Ryan Leckey
2020-03-20 20:10:10 -07:00

View File

@@ -210,3 +210,21 @@ async fn pool_smoke_test() -> anyhow::Result<()> {
Ok(())
}
#[cfg_attr(feature = "runtime-async-std", async_std::test)]
#[cfg_attr(feature = "runtime-tokio", tokio::test)]
async fn test_fetch_one_and_ping() -> anyhow::Result<()> {
let mut conn = new::<MySql>().await?;
let (_id,): (i32,) = sqlx::query_as("SELECT 1 as id")
.fetch_one(&mut conn)
.await?;
conn.ping().await?;
let (_id,): (i32,) = sqlx::query_as("SELECT 1 as id")
.fetch_one(&mut conn)
.await?;
Ok(())
}