chore: remove seaorm
This commit is contained in:
Generated
+21
-804
File diff suppressed because it is too large
Load Diff
@@ -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"] }
|
||||
|
||||
@@ -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::*;
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user