chore: readmes

chore: doc comments on public
This commit is contained in:
thesimplekid
2024-06-28 10:40:09 +01:00
parent aa65879482
commit b528964fb6
54 changed files with 598 additions and 109 deletions

View File

@@ -21,12 +21,14 @@ use sqlx::{ConnectOptions, Row};
pub mod error;
/// Mint SQLite Database
#[derive(Debug, Clone)]
pub struct MintSqliteDatabase {
pool: SqlitePool,
}
impl MintSqliteDatabase {
/// Create new [`MintSqliteDatabase`]
pub async fn new(path: &Path) -> Result<Self, Error> {
let path = path.to_str().ok_or(Error::InvalidDbPath)?;
let _conn = SqliteConnectOptions::from_str(path)?
@@ -42,6 +44,7 @@ impl MintSqliteDatabase {
Ok(Self { pool })
}
/// Migrate [`MintSqliteDatabase`]
pub async fn migrate(&self) {
sqlx::migrate!("./src/mint/migrations")
.run(&self.pool)