about summary refs log tree commit diff
path: root/src/database.rs
diff options
context:
space:
mode:
authorJoan Lledó <jlledom@member.fsf.org>2023-09-16 12:55:40 +0200
committerJoan Lledó <jlledom@member.fsf.org>2023-09-30 13:14:49 +0200
commit5adf507e2a0d17f88ab6bc4541f6f2cb12bde193 (patch)
tree0931398a72233b754f3d6a4f93cb027c2997f5a2 /src/database.rs
parenta03368c2c0295c4a4fd64afc1ea684a9bfce80e4 (diff)
downloadFurtherance-5adf507e2a0d17f88ab6bc4541f6f2cb12bde193.tar.zst
DB Query: order by name
So the dedup method works properly
Diffstat (limited to 'src/database.rs')
-rw-r--r--src/database.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/database.rs b/src/database.rs
index 4553460..8a7c6c9 100644
--- a/src/database.rs
+++ b/src/database.rs
@@ -354,7 +354,7 @@ pub fn get_list_by_name(task_name: String) -> Result<Vec<Task>, rusqlite::Error>
     let mut tasks_vec: Vec<Task> = Vec::new();
     let name_param = format!("%{}%", task_name);
 
-    let mut query = conn.prepare("SELECT * FROM tasks WHERE lower(task_name) LIKE lower(:task_name)")?;
+    let mut query = conn.prepare("SELECT * FROM tasks WHERE lower(task_name) LIKE lower(:task_name) ORDER BY task_name")?;
     let task_iter = query.query_map(&[(":task_name", &name_param)], |row| {
         Ok(Task {
             id: row.get(0)?,