remove unused returns, and reexport ConnectOption
All checks were successful
Test / verify-generated-code (pull_request) Successful in 1m38s
Test / test (pull_request) Successful in 3m30s
Test / lint (pull_request) Successful in 3m57s

This commit is contained in:
GW_MC
2025-11-19 21:02:03 +08:00
parent 800c55238d
commit 3de9ecc5c1

View File

@@ -1,8 +1,7 @@
use sea_orm::ConnectOptions; pub use sea_orm::ConnectOptions;
pub mod generated; pub mod generated;
pub async fn get_connection<T: FnOnce(&mut ConnectOptions) -> &mut ConnectOptions>( pub async fn get_connection<T: FnOnce(&mut ConnectOptions)>(
connection_string: &str, connection_string: &str,
option_fn: Option<T>, option_fn: Option<T>,
) -> Result<sea_orm::DatabaseConnection, sea_orm::DbErr> { ) -> Result<sea_orm::DatabaseConnection, sea_orm::DbErr> {
@@ -14,7 +13,7 @@ pub async fn get_connection<T: FnOnce(&mut ConnectOptions) -> &mut ConnectOption
.connect_timeout(std::time::Duration::from_secs(8)) .connect_timeout(std::time::Duration::from_secs(8))
.idle_timeout(std::time::Duration::from_secs(8)) .idle_timeout(std::time::Duration::from_secs(8))
.test_before_acquire(true) .test_before_acquire(true)
.sqlx_logging(false); .sqlx_logging(true);
if let Some(option_fn) = option_fn { if let Some(option_fn) = option_fn {
option_fn(&mut opt); option_fn(&mut opt);