diff options
| author | Ellie Huxtable <ellie@atuin.sh> | 2024-07-03 08:10:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-03 08:10:12 +0100 |
| commit | 5fe8ae05e562bd3efe03224851c3b9365d09a897 (patch) | |
| tree | 3b8f98883ba87f16302d9d81e0f4bb4a30900a27 /crates/atuin-client/src/record | |
| parent | feat: monitor idx cache consistency before switching (#2229) (diff) | |
| download | atuin-5fe8ae05e562bd3efe03224851c3b9365d09a897.zip | |
fix: idx cache inconsistency (#2231)
Diffstat (limited to 'crates/atuin-client/src/record')
| -rw-r--r-- | crates/atuin-client/src/record/sqlite_store.rs | 19 |
1 files changed, 10 insertions, 9 deletions
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<Vec<Record<EncryptedData>>> { - 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) } |
