From 5adf507e2a0d17f88ab6bc4541f6f2cb12bde193 Mon Sep 17 00:00:00 2001 From: Joan Lledó Date: Sat, 16 Sep 2023 12:55:40 +0200 Subject: DB Query: order by name So the dedup method works properly --- src/database.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, rusqlite::Error> let mut tasks_vec: Vec = 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)?, -- cgit 1.4.1