diff options
author | r3pll <106473215+r3pll@users.noreply.github.com> | 2022-06-07 14:14:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-07 14:14:59 +0300 |
commit | 02c76729565c06cfeaa0b1029bc9768cd3b46d7d (patch) | |
tree | 3642cd2c2da187250ef4708061d81208e57740b5 /src/database.rs | |
parent | 08a3a2416e6b5357911815d49e074928dcc5d3e6 (diff) | |
parent | 89955b21d2a048037822afb60f5200f9da76c487 (diff) | |
download | Furtherance-02c76729565c06cfeaa0b1029bc9768cd3b46d7d.tar.zst |
Merge pull request #1 from lakoliu/main
1
Diffstat (limited to 'src/database.rs')
-rwxr-xr-x | src/database.rs | 26 |
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())?; |