From b5c9f0b4a22dcb08b54e88b57023cfaaeba6cc4f Mon Sep 17 00:00:00 2001 From: theMackabu Date: Sun, 17 Dec 2023 21:28:49 -0800 Subject: [PATCH] support kv only --- src/config/structs.rs | 6 ------ src/main.rs | 11 ----------- 2 files changed, 17 deletions(-) diff --git a/src/config/structs.rs b/src/config/structs.rs index da3b66c..7e5bc1d 100644 --- a/src/config/structs.rs +++ b/src/config/structs.rs @@ -21,7 +21,6 @@ pub struct Database { pub kv: Option, pub mongo: Option, pub redis: Option, - pub sqlite: Option, } #[derive(Clone, Serialize, Deserialize)] @@ -29,11 +28,6 @@ pub struct KV { pub method: String, } -#[derive(Clone, Serialize, Deserialize)] -pub struct SQlite { - pub connect: String, -} - #[derive(Clone, Serialize, Deserialize)] pub struct Redis { pub server: String, diff --git a/src/main.rs b/src/main.rs index b5eb1f2..c41fd84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -417,9 +417,6 @@ mod kv_db { pub fn drop_db(conn: KV) { drop(conn.db.borrow()); } } -#[export_module] -mod sqlite_db {} - #[export_module] mod redis_db { #[derive(Clone)] @@ -593,9 +590,6 @@ mod redis_db { } } -#[export_module] -mod sqlx {} - #[export_module] mod http { #[derive(Clone)] @@ -770,16 +764,11 @@ async fn handler(url: Path, req: HttpRequest, config: Data) -> i engine.register_static_module("http", http.into()); engine.register_static_module("exists", exists.into()); - // add redis support, sqlx, if let Some(database) = &config.database { if let Some(_) = &database.kv { let kv = exported_module!(kv_db); engine.register_static_module("kv", kv.into()); } - if let Some(_) = &database.sqlite { - let sqlite = exported_module!(sqlite_db); - engine.register_static_module("sqlite", sqlite.into()); - } if let Some(_) = &database.mongo { let mongo = exported_module!(mongo_db); engine.register_static_module("mongo", mongo.into()); -- GitLab