use TempDatabase from commons in tests/

This commit is contained in:
Nikita Sivukhin 2025-02-02 19:34:15 +04:00
parent 43c9fc3c5c
commit 300f278ff3
5 changed files with 29 additions and 15 deletions

View file

@ -12,6 +12,13 @@ pub struct TempDatabase {
#[allow(dead_code, clippy::arc_with_non_send_sync)]
impl TempDatabase {
pub fn new_empty() -> Self {
let mut path = TempDir::new().unwrap().into_path();
path.push("test.db");
let io: Arc<dyn limbo_core::IO> = Arc::new(limbo_core::PlatformIO::new().unwrap());
Self { path, io }
}
pub fn new(table_sql: &str) -> Self {
let mut path = TempDir::new().unwrap().into_path();
path.push("test.db");