Skip to content

Commit

Permalink
fix keys clause
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Dec 18, 2024
1 parent ee9f43a commit 496364f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/torii/grpc/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ impl DojoWorld {
let keys_pattern = build_keys_pattern(keys_clause)?;

let where_clause = format!(
"WHERE {table}.keys REGEXP ? {}",
"{table}.keys REGEXP ? {}",
if entity_updated_after.is_some() {
format!("AND {table}.updated_at >= ?")
} else {
Expand All @@ -460,7 +460,7 @@ impl DojoWorld {
r#"
SELECT count(*)
FROM {table}
{where_clause}
WHERE {where_clause}
"#
);
let mut count_query = sqlx::query_scalar(&count_query);
Expand All @@ -479,7 +479,7 @@ impl DojoWorld {
SELECT {table}.id, {table}.data, {table}.model_id, group_concat({model_relation_table}.model_id) as model_ids
FROM {table}
JOIN {model_relation_table} ON {table}.id = {model_relation_table}.entity_id
{where_clause}
WHERE {where_clause}
GROUP BY {table}.event_id
ORDER BY {table}.event_id DESC
"#
Expand Down

0 comments on commit 496364f

Please sign in to comment.