about summary refs log tree commit diff
path: root/src/database.rs
diff options
context:
space:
mode:
authorRicky Kresslein <rk@lakoliu.com>2022-06-05 12:37:34 +0300
committerRicky Kresslein <rk@lakoliu.com>2022-06-05 12:42:10 +0300
commit825a2662b1856931549fc2de1164e89b09c7f4aa (patch)
tree4fa17edbd2e366b5046f264e1aabd5220a8ba274 /src/database.rs
parent8d85a8f7a7be6fcb3cb383d6e59f189864b81044 (diff)
downloadFurtherance-825a2662b1856931549fc2de1164e89b09c7f4aa.tar.zst
Reports feature (Issue #32)
Diffstat (limited to 'src/database.rs')
-rwxr-xr-xsrc/database.rs26
1 files changed, 26 insertions, 0 deletions
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<Vec<Task>, rusqlite::Error> {
 
 }
 
+// pub fn retrieve_date_range() -> Result<Vec<Task>, 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<Task> = 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())?;