mycommon-utils 0.1.2

Common utilities library for database operations, Redis caching and system utilities
Documentation
1
2
3
4
5
6
7
8
9
10
// use std::sync::{Arc};
// use sea_orm::DatabaseConnection;
// use crate::database::config::{DATABASE};

// 获取一个 DB 连接
// pub fn get_connection() -> Arc<DatabaseConnection> {
//     let db = DATABASE.get().unwrap();
//     db.clone() // 克隆 Arc,而不是克隆 DatabaseConnection
// }