mirror of
https://github.com/MedzikUser/HomeDisk.git
synced 2024-08-14 21:46:53 +00:00
14 lines
277 B
Rust
14 lines
277 B
Rust
|
use sqlx::{Connection, SqliteConnection};
|
||
|
|
||
|
pub struct Database {
|
||
|
pub conn: SqliteConnection,
|
||
|
}
|
||
|
|
||
|
impl Database {
|
||
|
pub async fn connect() -> Result<Self, sqlx::Error> {
|
||
|
let conn = SqliteConnection::connect("homedisk.db").await?;
|
||
|
|
||
|
Ok(Self { conn })
|
||
|
}
|
||
|
}
|