use std::path::Path; use anyhow::Result; use rusqlite::Connection; pub struct DataBase { sql: Connection, } impl DataBase { pub async fn new(path: impl AsRef) -> Result { let me = Self { sql: Connection::open(path)?, }; me.generate_tables()?; Ok(me) } fn generate_tables(&self) -> Result<()> { todo!() } pub async fn write(&self, device_name: &str, time: u64, watts: f32) -> Result<()> { todo!() } }