#[cfg(target_arch = "wasm32")]
fn main() {}
#[cfg(not(target_arch = "wasm32"))]
fn main() -> anyhow::Result<()> {
use std::path::PathBuf;
let manifest_dir = env!("CARGO_MANIFEST_DIR");
let fixture_path = PathBuf::from(manifest_dir).join("tests/fixtures/compat.graph");
let tmp_path = fixture_path.with_extension("graph.tmp");
let _ = std::fs::remove_file(&tmp_path);
let _ = std::fs::remove_file(tmp_path.with_extension("wal"));
let db = minigraf::Minigraf::open(&tmp_path)?;
db.execute(r#"(transact [[:alice :name "Alice"]])"#)?;
db.execute("(transact [[:alice :age 30]])")?;
db.checkpoint()?;
drop(db);
let wal_path = tmp_path.with_extension("graph.tmp.wal");
let _ = std::fs::remove_file(&wal_path);
std::fs::rename(&tmp_path, &fixture_path)?;
println!("Written: {}", fixture_path.display());
Ok(())
}