Closed as not planned
Closed as not planned
Description
Setup
Versions
- Rust: 1.72.1
- Diesel: 2.1.1
- Diesel_async: 0.4.1
- Database: Postgres 15
- Operating System: Arch
Feature Flags
- diesel: ["postgres", "chrono", "uuid"]
- diesel_async:["postgres", "bb8"]
Problem Description
I'm using meilisearch and postgres for an API using axum and when I use meilisearch with the code:
let results = meilisearch_client
.index("programs")
.search()
.with_query(&query)
.with_limit(pagination.limit.into())
.execute()
.await?;
I have and error:
error[E0277]: the trait bound `&mut SearchQuery<'_>: QueryFragment<_>` is not satisfied
--> src/controllers/programs.rs:66:18
|
66 | .execute()
| ^^^^^^^ the trait `QueryFragment<_>` is not implemented for `&mut SearchQuery<'_>`
|
= help: the following other types implement trait `QueryFragment<DB, SP>`:
<diesel_async::pg::TransactionBuilder<'a, C> as QueryFragment<Pg>>
<Box<T> as QueryFragment<DB>>
<DeleteStatement<T, U, Ret> as QueryFragment<DB>>
<FromClause<F> as QueryFragment<DB>>
<BoxedLimitOffsetClause<'a, Pg> as QueryFragment<Pg>>
<query_builder::select_clause::DefaultSelectClause<QS> as QueryFragment<DB>>
<BoxedSqlQuery<'_, DB, Query> as QueryFragment<DB>>
<query_builder::where_clause::BoxedWhereClause<'a, DB> as QueryFragment<DB>>
and 384 others
= note: required for `&mut SearchQuery<'_>` to implement `diesel_async::methods::ExecuteDsl<_, _>`
note: required by a bound in `diesel_async::RunQueryDsl::execute`
--> /home/user/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/diesel-async-0.4.1/src/run_query_dsl/mod.rs:222:15
|
219 | fn execute<'conn, 'query>(self, conn: &'conn mut Conn) -> Conn::ExecuteFuture<'conn, 'query>
| ------- required by a bound in this associated function
...
222 | Self: methods::ExecuteDsl<Conn> + 'query,
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::execute`
The compiler things that the execute() of meilisearch is the execute() from diesel_async::RunQueryDsl.
What are you trying to accomplish?
Execute the meilisearch sdk query.
I'm using meilisearch-sdk = "0.24.2"
What is the expected output?
What is the actual output?
Are you seeing any additional errors?
Steps to reproduce
Checklist
- [ X] I have already looked over the issue tracker for similar possible closed issues.
- [ X] This issue can be reproduced on Rust's stable channel. (Your issue will be
closed if this is not the case) - This issue can be reproduced without requiring a third party crate