sqlx/tests/sqlite/any.rs
qwerty2501 00b077ab14
Is tests/x.py maintained? And I tried fix it. (#2754)
* chore:Added ipaddr extension library to gitignore

* fix:In a Linux environment, shared libraries in the current directory are not loaded, so add the current directory to the LD_LIBRARY_PATH environment variable.

* fix: Since confrict primary key when running multiple sqlite tests, removed specific primary key in insert.

* chore: Since avoid git modified targeting, copy the db file to new test db file.

* fix: Since docker mysql 5.7 using yaSSL(It only supports TLSv1.1), avoid running when using rustls.
2023-10-19 14:54:01 -07:00

18 lines
482 B
Rust

use sqlx::{Any, Sqlite};
use sqlx_test::new;
#[sqlx_macros::test]
async fn it_encodes_bool_with_any() -> anyhow::Result<()> {
sqlx::any::install_default_drivers();
let mut conn = new::<Any>().await?;
let res = sqlx::query("INSERT INTO accounts (name, is_active) VALUES (?, ?)")
.bind("Harrison Ford")
.bind(true)
.execute(&mut conn)
.await
.expect("failed to encode bool");
assert_eq!(res.rows_affected(), 1);
Ok(())
}