Files
rukosync/src/reader.rs
T
2026-10-06 08:24:08 +03:00

15 lines
350 B
Rust

use std::path::Path;
use tokio_rusqlite::{Connection, OpenFlags};
pub struct Reader {
pub connection: Connection,
}
impl Reader {
pub async fn new(path: &Path) -> Result<Self, tokio_rusqlite::Error> {
let connection = Connection::open_with_flags(path, OpenFlags::SQLITE_OPEN_READ_ONLY).await?;
Ok(Self{connection})
}
}