use persistant_core::{Config, Matrix};
use persistant_kv::KvOnRelational;
use persistant_sqlx::MysqlBackend;
#[tokio::main(flavor = "current_thread")]
async fn main() {
let url = std::env::var("PERSISTANT_TEST_MYSQL_URL")
.expect("PERSISTANT_TEST_MYSQL_URL must name a MySQL server");
let db = MysqlBackend::connect(&url).await.expect("connect");
let kv = KvOnRelational::open(db).await.expect("open");
let env = Config::new()
.with("os", std::env::consts::OS)
.with("arch", std::env::consts::ARCH);
let config = Config::new().with("dialect", "mysql");
let rows: Vec<_> = persistant_kv::conformance::certify(&kv, &config, &env)
.await
.into_iter()
.map(|c| c.row)
.collect();
print!("{}", Matrix::from_rows(rows).to_tsv());
}