Initial commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
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})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user