54
Looking at the diesel docs it should be site_aggregates::table.filter(site_aggregates::site_id.eq(1)).load(…
https://diesel.rs/ see the third example
Looking at the diesel docs it should be site_aggregates::table.filter(site_aggregates::site_id.eq(1)).load(…
https://diesel.rs/ see the third example
site_aggregates::table.filter(site_aggregates::site_id.eq(1)).first::<Self>(conn).await
^^ `schema::site_aggregates::columns::site_id` is not an iterator
Try site_aggregates::dsl::site_id.eq(1)
.
second reply.
Going over both error messages again, found this: https://stackoverflow.com/questions/70389667/rust-diesel-method-filter-exists-for-schema-table-but-its-trait-bounds-were-n
seems adding:
use diesel::prelude::*;
Might be helping. This compiles now:
site_aggregates::table.filter(site_aggregates::site_id.eq(1)).first::<Self>(conn).await
--> crates/db_schema/src/aggregates/site_aggregates.rs:12:35
|
12 | site_aggregates::dsl::site_id.eq(1).first::<Self>(conn).await
| ^^ `schema::site_aggregates::columns::site_id` is not an iterator
|
::: crates/db_schema/src/schema.rs:817:9
|
817 | site_id -> Int4,
| -------
| |
| method `eq` not found for this struct
| doesn't satisfy `_: Iterator`
|
= note: the following trait bounds were not satisfied:
`schema::site_aggregates::columns::site_id: Iterator`
which is required by `&mut schema::site_aggregates::columns::site_id: Iterator`