I'm not sure what the problem is, but I made sure to check the documentation and this seems like weird behavior #877
Unanswered
MillerVictor
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
dependencies
rust version
rustc 1.84.1 (e71f9a9a9 2025-01-27)
database
the rust code
Error in
error[E0283]: type annotations needed
--> common/src/database/access/user.rs:134:44
|
134 | let rows = sqlx::query_as_with::<,User, >(&sql, values);
| ^^^^ cannot infer type for type parameter
R
|
= note: multiple
impl
s satisfying&str: ColumnIndex<_>
found in the following crates:sqlx_core
,sqlx_mysql
:- impl ColumnIndex for &str;
- impl ColumnIndex<MySqlStatement<'>> for &str;
- impl<'i> ColumnIndex for &'i str;
- impl<'i> ColumnIndex<AnyStatement<'>> for &'i str;
note: required for
User
to implementfor<'r> FromRow<'r, _>
--> common/src/database/access/user.rs:70:10
|
70 | #[derive(sqlx::FromRow, Debug)]
| ^^^^^^^^^^^^^ unsatisfied trait bound introduced in this
derive
macro71 | pub struct User {
| ^^^^
note: required by a bound in
sqlx::query_as_with
--> /home/victor/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-core-0.8.3/src/query_as.rs:364:8
|
360 | pub fn query_as_with<'q, DB, O, A>(sql: &'q str, arguments: A) -> QueryAs<'q, DB, O, A>
| ------------- required by a bound in this function
...
364 | O: for<'r> FromRow<'r, DB::Row>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in
query_as_with
= note: this error originates in the derive macro
sqlx::FromRow
(in Nightly builds, run with -Z macro-backtrace for more info)What happened here
Beta Was this translation helpful? Give feedback.
All reactions