From 825a2662b1856931549fc2de1164e89b09c7f4aa Mon Sep 17 00:00:00 2001 From: Ricky Kresslein Date: Sun, 5 Jun 2022 12:37:34 +0300 Subject: Reports feature (Issue #32) --- src/database.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/database.rs') diff --git a/src/database.rs b/src/database.rs index 69b56dc..a2485c6 100755 --- a/src/database.rs +++ b/src/database.rs @@ -120,6 +120,32 @@ pub fn retrieve() -> Result, rusqlite::Error> { } +// pub fn retrieve_date_range() -> Result, rusqlite::Error> { + // Retrieve all tasks from the database +// let conn = Connection::open(get_directory())?; + +// let mut query = conn.prepare("SELECT * FROM tasks ORDER BY start_time")?; +// let task_iter = query.query_map([], |row| { +// Ok(Task { +// id: row.get(0)?, +// task_name: row.get(1)?, +// start_time: row.get(2)?, +// stop_time: row.get(3)?, +// tags: row.get(4)?, +// }) +// })?; + +// let mut tasks_vec: Vec = Vec::new(); +// for task_item in task_iter { +// let start = DateTime::parse_from_rfc3339(&task_item.start_time).unwrap(); +// let stop = DateTime::parse_from_rfc3339(&task_item.stop_time).unwrap(); +// tasks_vec.push(task_item.unwrap()); +// } + +// Ok(tasks_vec) + +// } + pub fn update_start_time(id: i32, start_time: String) -> Result<()> { let conn = Connection::open(get_directory())?; -- cgit 1.4.1