From 445e359147619d6a853baff8ec5a953fb9007008 Mon Sep 17 00:00:00 2001 From: gianalarcon Date: Wed, 28 Feb 2024 21:35:16 -0500 Subject: [PATCH] Fix sql query --- crates/torii/grpc/src/server/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/torii/grpc/src/server/mod.rs b/crates/torii/grpc/src/server/mod.rs index a84e0c8c50..2eaa22a314 100644 --- a/crates/torii/grpc/src/server/mod.rs +++ b/crates/torii/grpc/src/server/mod.rs @@ -130,7 +130,8 @@ impl DojoWorld { async fn events_all(&self, limit: u32, offset: u32) -> Result, Error> { let query = r#" SELECT keys, data, transaction_hash - FROM events DESC + FROM events + ORDER BY id DESC LIMIT ? OFFSET ? "# .to_string(); @@ -280,7 +281,8 @@ impl DojoWorld { let events_query = r#" SELECT keys, data, transaction_hash FROM events - WHERE keys LIKE ? DESC + WHERE keys LIKE ? + ORDER BY id DESC LIMIT ? OFFSET ? "# .to_string();