30 lines
728 B
Rust
30 lines
728 B
Rust
#![allow(dead_code)]
|
|
|
|
pub mod database;
|
|
pub mod error;
|
|
pub mod helper;
|
|
pub(crate) mod migration;
|
|
pub mod query;
|
|
|
|
#[cfg(test)]
|
|
mod test {
|
|
use crate::database::Database;
|
|
use geoffrey_models::models::locations::LocationDb;
|
|
use geoffrey_models::models::player::Player;
|
|
use lazy_static::lazy_static;
|
|
use std::path::Path;
|
|
use std::sync::Mutex;
|
|
|
|
lazy_static! {
|
|
pub static ref DB: Database = Database::new(Path::new("../test_database")).unwrap();
|
|
pub static ref LOCK: Mutex<()> = Mutex::default();
|
|
}
|
|
|
|
pub fn cleanup() {
|
|
DB.clear_tree::<Player>().unwrap();
|
|
DB.clear_tree::<LocationDb>().unwrap();
|
|
DB.db.clear().unwrap();
|
|
DB.db.flush().unwrap();
|
|
}
|
|
}
|