You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a MySqlPool connection, but i cant get a vec of integers:
let ids: Vec<i64> = sqlx::query_as("SELECT id, id FROM table LIMIT 10").fetch_all(&pool).await?;
Compiler said: the trait bound "for<'r> i64: FromRow<'r, MySqlRow>" is not satisfied
So, i am able to do: let ids: Vec<(i64,)> = sqlx::query_as("SELECT id FROM table LIMIT 10").fetch_all(&pool).await?;
I guess it is because ( ) implements some traits?
Is there any way to just query a list (vec) or array of integers (ids)?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a MySqlPool connection, but i cant get a vec of integers:
let ids: Vec<i64> = sqlx::query_as("SELECT id, id FROM table LIMIT 10").fetch_all(&pool).await?;
Compiler said:
the trait bound "for<'r> i64: FromRow<'r, MySqlRow>" is not satisfied
So, i am able to do:
let ids: Vec<(i64,)> = sqlx::query_as("SELECT id FROM table LIMIT 10").fetch_all(&pool).await?;
I guess it is because ( ) implements some traits?
Is there any way to just query a list (vec) or array of integers (ids)?
Beta Was this translation helpful? Give feedback.
All reactions