use sqlx::Any;
use sqlx_test::new;
#[sqlx_macros::test]
async fn any_sets_last_insert_id() -> anyhow::Result<()> {
sqlx::any::install_default_drivers();
let mut conn = new::<Any>().await?;
let _ = sqlx::query(
"CREATE TEMPORARY TABLE users (id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, name TEXT NOT NULL)",
)
.execute(&mut conn)
.await?;
let result = sqlx::query("INSERT INTO users (name) VALUES (?)")
.bind("Glorbo")
.execute(&mut conn)
.await?;
assert_eq!(result.last_insert_id(), Some(1));
Ok(())
}