In process of separating cache from database.

This commit is contained in:
2023-02-13 10:19:20 -05:00
parent 716b559062
commit 894fcbcd02
2 changed files with 58 additions and 90 deletions

View File

@ -1,6 +1,6 @@
mod cache;
mod store;
pub mod error;
mod store;
use async_std::{
fs::{create_dir, read, remove_file, write},
@ -8,7 +8,6 @@ use async_std::{
sync::{Arc, Mutex},
task::{sleep, spawn},
};
use store::Store;
use error::DBError;
use rand::{distributions::Alphanumeric, thread_rng, Rng};
use std::{
@ -16,6 +15,7 @@ use std::{
fmt, slice, str,
time::{Duration, Instant},
};
use store::Store;
const DATA: &str = "data";
const ENTRY: &str = "databases";
@ -404,11 +404,13 @@ mod data {
let id = "*gsdfg";
let output = mtt.db.add("database", name, id).await;
assert_eq!(output.session, [id], "should update session info.");
/*
assert_eq!(
mtt.db.list(["database"].to_vec()).await.unwrap(),
[name],
"Should list the databases."
);
*/
}
}