Skip to content

Commit

Permalink
fix: event message
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Sep 24, 2024
1 parent 4915e74 commit 10f4805
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions crates/torii/core/src/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,6 @@ impl Sql {
let entity_id = format!("{:#x}", poseidon_hash_many(&keys));
let model_id = format!("{:#x}", compute_selector_from_names(model_namespace, model_name));

self.query_queue.enqueue(
"INSERT INTO event_model (entity_id, model_id) VALUES (?, ?) ON CONFLICT(entity_id, \
model_id) DO NOTHING",
vec![Argument::String(entity_id.clone()), Argument::String(model_id.clone())],
QueryType::Other,
);

let keys_str = felts_sql_string(&keys);
let insert_entities = "INSERT INTO event_messages (id, keys, event_id, executed_at) \
VALUES (?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET \
Expand All @@ -321,6 +314,12 @@ impl Sql {
],
QueryType::Other,
);
self.query_queue.enqueue(
"INSERT INTO event_model (entity_id, model_id) VALUES (?, ?) ON CONFLICT(entity_id, \
model_id) DO NOTHING",
vec![Argument::String(entity_id.clone()), Argument::String(model_id.clone())],
QueryType::Other,
);

let path = vec![namespaced_name];
self.build_set_entity_queries_recursive(
Expand Down

0 comments on commit 10f4805

Please sign in to comment.