feat: 简单写个运行框架
This commit is contained in:
7
src/database.rs
Normal file
7
src/database.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
use sea_orm::{ConnectOptions, Database, DatabaseConnection};
|
||||
|
||||
use crate::Result;
|
||||
pub async fn database_connection() -> Result<DatabaseConnection> {
|
||||
let opt = ConnectOptions::new("sqlite://./data.sqlite?mode=rwc");
|
||||
Ok(Database::connect(opt).await?)
|
||||
}
|
||||
Reference in New Issue
Block a user