From 5fe8ae05e562bd3efe03224851c3b9365d09a897 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Wed, 3 Jul 2024 08:10:12 +0100 Subject: fix: idx cache inconsistency (#2231) --- crates/atuin-client/src/record/sqlite_store.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'crates/atuin-client/src') diff --git a/crates/atuin-client/src/record/sqlite_store.rs b/crates/atuin-client/src/record/sqlite_store.rs index 31de311b..63ef42f8 100644 --- a/crates/atuin-client/src/record/sqlite_store.rs +++ b/crates/atuin-client/src/record/sqlite_store.rs @@ -219,15 +219,16 @@ impl Store for SqliteStore { idx: RecordIdx, limit: u64, ) -> Result>> { - let res = - sqlx::query("select * from store where idx >= ?1 and host = ?2 and tag = ?3 limit ?4") - .bind(idx as i64) - .bind(host.0.as_hyphenated().to_string()) - .bind(tag) - .bind(limit as i64) - .map(Self::query_row) - .fetch_all(&self.pool) - .await?; + let res = sqlx::query( + "select * from store where idx >= ?1 and host = ?2 and tag = ?3 order by idx asc limit ?4", + ) + .bind(idx as i64) + .bind(host.0.as_hyphenated().to_string()) + .bind(tag) + .bind(limit as i64) + .map(Self::query_row) + .fetch_all(&self.pool) + .await?; Ok(res) } -- cgit v1.3.1