Open
Description
async fn test(conn: PgPool) {
use crate::row::Row;
let value = crate::query::query::<Postgres>("select 1 + 1")
.map(|row: PgRow| row.get::<i32, _>(0))
.fetch_all(&conn)
.await
.unwrap();
}
error[E0599]: no method named `fetch_all` found for struct `query::Map<'_, Postgres, impl std::marker::Send+FnMut<(<Postgres as Database>::Row,)>, PgArguments>` in the current scope
--> sqlx-core/src/postgres/mod.rs:48:10
|
48 | .fetch_all(&conn)
| ^^^^^^^^^ method not found in `query::Map<'_, Postgres, impl std::marker::Send+FnMut<(<Postgres as Database>::Row,)>, PgArguments>`
|
::: sqlx-core/src/query.rs:34:1
|
34 | pub struct Map<'q, DB: Database, F, A> {
| -------------------------------------- method `fetch_all` not found for this
|
= note: the method `fetch_all` exists but the following trait bounds were not satisfied:
`<impl std::marker::Send+FnMut<(<Postgres as Database>::Row,)> as FnOnce<(PgRow,)>>::Output = std::result::Result<_, error::Error>`
`impl std::marker::Send+FnMut<(<Postgres as Database>::Row,)>: FnMut<(PgRow,)>`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.
error: could not compile `sqlx-core`
From https://discord.com/channels/665528275556106240/665528275556106243/801701725001875458