Made Database the mtt engine.
This commit is contained in:
parent
dfa96dfc00
commit
620e5593e0
@ -4,10 +4,10 @@ use tide::{
|
||||
Request, Response,
|
||||
};
|
||||
|
||||
mod database;
|
||||
mod morethantext;
|
||||
mod settings;
|
||||
|
||||
use database::MoreThanText;
|
||||
use morethantext::MoreThanText;
|
||||
use settings::Settings;
|
||||
|
||||
#[async_std::main]
|
||||
@ -20,7 +20,7 @@ async fn main() -> tide::Result<()> {
|
||||
}
|
||||
|
||||
async fn app_setup() -> tide::Server<MoreThanText> {
|
||||
let db = MoreThanText::new();
|
||||
let db = MoreThanText::new().await;
|
||||
let mut app = tide::with_state(db);
|
||||
app.at("/").get(home);
|
||||
app.with(
|
||||
|
@ -94,9 +94,10 @@ impl Table {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Database;
|
||||
#[derive(Clone)]
|
||||
pub struct MoreThanText;
|
||||
|
||||
impl Database {
|
||||
impl MoreThanText {
|
||||
pub async fn new() -> Self {
|
||||
Self {}
|
||||
}
|
||||
@ -177,12 +178,12 @@ mod databases {
|
||||
|
||||
#[async_std::test]
|
||||
async fn new_database() {
|
||||
Database::new().await;
|
||||
MoreThanText::new().await;
|
||||
}
|
||||
|
||||
#[async_std::test]
|
||||
async fn add_table() {
|
||||
let db = Database::new().await;
|
||||
let db = MoreThanText::new().await;
|
||||
db.add_table("fred".to_string()).await;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user