remove unused returns, and reexport ConnectOption
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user