chore: remove seaorm

This commit is contained in:
Maulana Sodiqin
2025-02-25 02:02:01 +07:00
parent 44de53a49d
commit b8606ef0bb
4 changed files with 21 additions and 828 deletions
Generated
+21 -804
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -6,7 +6,6 @@ edition = "2021"
[dependencies]
axum = { version = "0.8.1", features = ["multipart"] }
log = "0.4.25"
sea-orm = { version = "1.1.4", features = ["sqlx-postgres", "macros", "with-json", "with-uuid", "runtime-tokio", "runtime-tokio-native-tls"] }
serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.138"
tokio = { version = "1.43.0", features = ["full"] }
-2
View File
@@ -3,7 +3,6 @@ pub mod axum;
pub mod jsonwebtoken;
pub mod lettre;
pub mod redis;
pub mod seaorm;
pub mod surrealdb;
pub use argon::*;
@@ -11,5 +10,4 @@ pub use axum::*;
pub use jsonwebtoken::*;
pub use lettre::*;
pub use redis::*;
pub use seaorm::*;
pub use surrealdb::*;
-21
View File
@@ -1,21 +0,0 @@
use log::LevelFilter;
use sea_orm::{ConnectOptions, Database, DatabaseConnection};
use std::{env, time::Duration};
pub async fn db_pgsql() -> DatabaseConnection {
let url = env::var("DATABASE_URL").expect("DATABASE_URL must be set");
let mut opt = ConnectOptions::new(&url);
opt.max_connections(100)
.min_connections(5)
.connect_timeout(Duration::from_secs(5))
.acquire_timeout(Duration::from_secs(5))
.idle_timeout(Duration::from_secs(3))
.max_lifetime(Duration::from_secs(10))
.sqlx_logging(true)
.sqlx_logging_level(LevelFilter::Info)
.set_schema_search_path("public");
match Database::connect(opt).await {
Ok(connect) => connect,
Err(error) => panic!("{}", error),
}
}