Skip to content

Commit

Permalink
opt(torii/core): add explicit limit to sql query
Browse files Browse the repository at this point in the history
Even though we where already using `fetch_one` to only fetch a single row, its documentation says to add a limit to the query explicitly.

commit-id:c0a96916
  • Loading branch information
lambda-0x committed Dec 4, 2024
1 parent 327e653 commit ffc9259
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/torii/core/src/executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ impl<'c, P: Provider + Sync + Send + 'static> Executor<'c, P> {
let semaphore = self.semaphore.clone();
let provider = self.provider.clone();
let res = sqlx::query_as::<_, (String, String)>(&format!(
"SELECT name, symbol FROM {TOKENS_TABLE} WHERE contract_address = ?"
"SELECT name, symbol FROM {TOKENS_TABLE} WHERE contract_address = ? LIMIT 1"
))
.bind(felt_to_sql_string(&register_erc721_token.contract_address))
.fetch_one(&mut **tx)
Expand Down

0 comments on commit ffc9259

Please sign in to comment.