From 34888827f8a06de835cbe5833a06914f28cce514 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Tue, 20 Apr 2021 17:07:11 +0100 Subject: Switch to Warp + SQLx, use async, switch to Rust stable (#36) * Switch to warp + sql, use async and stable rust * Update CI to use stable --- src/local/database.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/local/database.rs') diff --git a/src/local/database.rs b/src/local/database.rs index 977f11cc..abc22bb8 100644 --- a/src/local/database.rs +++ b/src/local/database.rs @@ -215,9 +215,9 @@ impl Database for Sqlite { } fn before(&self, timestamp: chrono::DateTime, count: i64) -> Result> { - let mut stmt = self.conn.prepare( - "SELECT * FROM history where timestamp <= ? order by timestamp desc limit ?", - )?; + let mut stmt = self + .conn + .prepare("SELECT * FROM history where timestamp < ? order by timestamp desc limit ?")?; let history_iter = stmt.query_map(params![timestamp.timestamp_nanos(), count], |row| { history_from_sqlite_row(None, row) @@ -236,7 +236,7 @@ impl Database for Sqlite { fn prefix_search(&self, query: &str) -> Result> { self.query( - "select * from history where command like ?1 || '%' order by timestamp asc", + "select * from history where command like ?1 || '%' order by timestamp asc limit 1000", &[query], ) } -- cgit v1.3.1