Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,37 @@ note: required by a bound in `diesel::RunQueryDsl::load`
| where
| Self: LoadQuery<'query, Conn, U>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::load`

error[E0277]: the trait bound `{type error}: FromSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text), Pg>` is not satisfied
--> tests/fail/any_is_only_selectable_if_inner_expr_is_selectable.rs:34:15
|
34 | .load(&mut conn);
| ---- ^^^^^^^^^ the trait `SingleValue` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text)`
| |
| required by a bound introduced by this call
|
= note: double check your type mappings via the documentation of `(diesel::sql_types::Integer, diesel::sql_types::Text)`
= note: `diesel::sql_query` requires the loading target to column names for loading values.
You need to provide a type that explicitly derives `diesel::deserialize::QueryableByName`
= help: the following other types implement trait `SingleValue`:
BigInt
Bool
CChar
Cidr
Citext
Datetime
Inet
Interval
and $N others
= note: required for `{type error}` to implement `FromStaticSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text), Pg>`
= note: required for `{type error}` to implement `FromSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text), Pg>`
= note: required for `(diesel::sql_types::Integer, diesel::sql_types::Text)` to implement `load_dsl::private::CompatibleType<{type error}, Pg>`
= note: required for `SelectStatement<FromClause<stuff::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<stuff::table>>, diesel::query_builder::distinct_clause::NoDistinctClause, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<stuff::columns::name, diesel::pg::expression::array_comparison::Any<more_stuff::columns::names>>>>>` to implement `LoadQuery<'_, diesel::PgConnection, {type error}>`
note: required by a bound in `diesel::RunQueryDsl::load`
--> $DIESEL/src/query_dsl/mod.rs
|
| fn load<'query, U>(self, conn: &mut Conn) -> QueryResult<Vec<U>>
| ---- required by a bound in this associated function
| where
| Self: LoadQuery<'query, Conn, U>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::load`
4 changes: 1 addition & 3 deletions diesel_compile_tests/tests/fail/auto_type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su
30 | #[dsl::auto_type]
| __________________-
31 | | fn users_with_posts_with_id_greater_than(id_greater_than: i32) -> _ {
32 | | // This fails because the macro infers the type of
33 | | // `user_has_post_with_id_greater_than(id_greater_than)` to be
34 | | // `user_has_post_with_id_greater_than<i32>`
... |
35 | | users::table
36 | | .filter(user_has_post_with_id_greater_than(id_greater_than))
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ error: Table contains more than 16 columns. Consider enabling the `32-column-tab
5 | | column_1 -> Integer,
6 | | column_2 -> Integer,
... |
22 | | }
23 | | }
| |_^
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,37 @@ note: required by a bound in `get_result`
| where
| Self: LoadQuery<'query, Conn, U>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::get_result`

error[E0277]: the trait bound `{type error}: FromSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text), Sqlite>` is not satisfied
--> tests/fail/delete_statement_does_not_support_returning_methods_on_sqlite.rs:17:21
|
17 | .get_result(&mut connection);
| ---------- ^^^^^^^^^^^^^^^ the trait `SingleValue` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text)`
| |
| required by a bound introduced by this call
|
= note: double check your type mappings via the documentation of `(diesel::sql_types::Integer, diesel::sql_types::Text)`
= note: `diesel::sql_query` requires the loading target to column names for loading values.
You need to provide a type that explicitly derives `diesel::deserialize::QueryableByName`
= help: the following other types implement trait `SingleValue`:
Array<ST>
BigInt
Bool
CChar
Cidr
Citext
Datetime
Inet
and $N others
= note: required for `{type error}` to implement `FromStaticSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text), Sqlite>`
= note: required for `{type error}` to implement `FromSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text), Sqlite>`
= note: required for `(diesel::sql_types::Integer, diesel::sql_types::Text)` to implement `load_dsl::private::CompatibleType<{type error}, Sqlite>`
= note: required for `DeleteStatement<users::table, diesel::query_builder::where_clause::WhereClause<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<columns::name, diesel::expression::bound::Bound<diesel::sql_types::Text, &str>>>>>` to implement `LoadQuery<'_, diesel::SqliteConnection, {type error}>`
note: required by a bound in `get_result`
--> $DIESEL/src/query_dsl/mod.rs
|
| fn get_result<'query, U>(self, conn: &mut Conn) -> QueryResult<U>
| ---------- required by a bound in this associated function
| where
| Self: LoadQuery<'query, Conn, U>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::get_result`
6 changes: 2 additions & 4 deletions diesel_compile_tests/tests/fail/derive/aliases.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ note: `posts::table` is defined in module `crate::posts` of the current crate
14 | | posts {
15 | | id -> Integer,
16 | | author -> Integer,
17 | | title -> Text,
18 | | }
... |
19 | | }
| |_^
note: `users::table` is defined in module `crate::users` of the current crate
Expand Down Expand Up @@ -251,8 +250,7 @@ error[E0599]: the method `select` exists for struct `SelectStatement<FromClause<
62 | | .inner_join(
63 | | post_alias_2.on(post_alias
64 | | .field(posts::author)
65 | | .eq(post_alias_2.field(posts::author))),
66 | | )
... |
67 | | .select((post_alias.field(posts::id), post_alias_2.field(posts::id)))
| | -^^^^^^ private field, not a method
| |_________|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,65 @@ note: required for `users::columns::name` to implement `AppearsOnTable<posts::ta
= note: required for `(posts::columns::name, users::columns::name)` to implement `AppearsOnTable<posts::table>`
= note: required for `(posts::columns::name, users::columns::name)` to implement `SelectableExpression<posts::table>`
= note: required for `posts::table` to implement `DistinctOnDsl<(posts::columns::name, users::columns::name)>`

error[E0277]: the trait bound `(diesel::sql_types::Integer, diesel::sql_types::Text): SingleValue` is not satisfied
--> tests/fail/distinct_on_allows_only_fields_of_table.rs:27:22
|
27 | .get_results(&mut connection);
| ----------- ^^^^^^^^^^^^^^^ the trait `SingleValue` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text)`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `SingleValue`:
Array<ST>
BigInt
Bool
CChar
Cidr
Citext
Datetime
Inet
and $N others
= note: required for `{type error}` to implement `FromStaticSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text), Pg>`
= note: required for `{type error}` to implement `FromSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text), Pg>`
= note: required for `(diesel::sql_types::Integer, diesel::sql_types::Text)` to implement `load_dsl::private::CompatibleType<{type error}, Pg>`
= note: required for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<posts::columns::id>>` to implement `LoadQuery<'_, diesel::PgConnection, {type error}>`
note: required by a bound in `get_results`
--> $DIESEL/src/query_dsl/mod.rs
|
| fn get_results<'query, U>(self, conn: &mut Conn) -> QueryResult<Vec<U>>
| ----------- required by a bound in this associated function
| where
| Self: LoadQuery<'query, Conn, U>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::get_results`

error[E0277]: the trait bound `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Text): SingleValue` is not satisfied
--> tests/fail/distinct_on_allows_only_fields_of_table.rs:31:21
|
31 | .get_result(&mut connection);
| ---------- ^^^^^^^^^^^^^^^ the trait `SingleValue` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Text)`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `SingleValue`:
Array<ST>
BigInt
Bool
CChar
Cidr
Citext
Datetime
Inet
and $N others
= note: required for `{type error}` to implement `FromStaticSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Text), Pg>`
= note: required for `{type error}` to implement `FromSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Text), Pg>`
= note: required for `(diesel::sql_types::Integer, diesel::sql_types::Text, diesel::sql_types::Text)` to implement `load_dsl::private::CompatibleType<{type error}, Pg>`
= note: required for `SelectStatement<FromClause<posts::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<posts::table>>, DistinctOnClause<(posts::columns::name, users::columns::name)>>` to implement `LoadQuery<'_, diesel::PgConnection, {type error}>`
note: required by a bound in `get_result`
--> $DIESEL/src/query_dsl/mod.rs
|
| fn get_result<'query, U>(self, conn: &mut Conn) -> QueryResult<U>
| ---------- required by a bound in this associated function
| where
| Self: LoadQuery<'query, Conn, U>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::get_result`
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,37 @@ note: required by a bound in `get_results`
| where
| Self: LoadQuery<'query, Conn, U>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::get_results`

error[E0277]: the trait bound `{type error}: FromSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text), Sqlite>` is not satisfied
--> tests/fail/distinct_on_clause_only_supported_for_pg.rs:16:41
|
16 | users.distinct_on(name).get_results(&mut sqlite_connection);
| ----------- ^^^^^^^^^^^^^^^^^^^^^^ the trait `SingleValue` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text)`
| |
| required by a bound introduced by this call
|
= note: double check your type mappings via the documentation of `(diesel::sql_types::Integer, diesel::sql_types::Text)`
= note: `diesel::sql_query` requires the loading target to column names for loading values.
You need to provide a type that explicitly derives `diesel::deserialize::QueryableByName`
= help: the following other types implement trait `SingleValue`:
Array<ST>
BigInt
Bool
CChar
Cidr
Citext
Datetime
Inet
and $N others
= note: required for `{type error}` to implement `FromStaticSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text), Sqlite>`
= note: required for `{type error}` to implement `FromSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text), Sqlite>`
= note: required for `(diesel::sql_types::Integer, diesel::sql_types::Text)` to implement `load_dsl::private::CompatibleType<{type error}, Sqlite>`
= note: required for `SelectStatement<FromClause<users::table>, diesel::query_builder::select_clause::DefaultSelectClause<FromClause<users::table>>, DistinctOnClause<columns::name>>` to implement `LoadQuery<'_, diesel::SqliteConnection, {type error}>`
note: required by a bound in `get_results`
--> $DIESEL/src/query_dsl/mod.rs
|
| fn get_results<'query, U>(self, conn: &mut Conn) -> QueryResult<Vec<U>>
| ----------- required by a bound in this associated function
| where
| Self: LoadQuery<'query, Conn, U>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::get_results`
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,34 @@ note: required for `posts::columns::id` to implement `AppearsOnTable<users::tabl
= note: 2 redundant requirements hidden
= note: required for `diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>` to implement `AppearsOnTable<users::table>`
= note: required for `BoxedSelectStatement<'_, diesel::sql_types::Text, FromClause<users::table>, _, users::columns::id>` to implement `HavingDsl<diesel::expression::grouped::Grouped<diesel::expression::operators::Eq<posts::columns::id, diesel::expression::bound::Bound<diesel::sql_types::Integer, i32>>>>`

error[E0277]: the trait bound `(diesel::sql_types::Integer, diesel::sql_types::Text): SingleValue` is not satisfied
--> tests/fail/having_cant_be_used_without_group_by.rs:28:60
|
28 | users::table.into_boxed().having(users::id.gt(1)).load(&mut conn);
| ---- ^^^^^^^^^ the trait `SingleValue` is not implemented for `(diesel::sql_types::Integer, diesel::sql_types::Text)`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `SingleValue`:
Array<ST>
BigInt
Bool
CChar
Cidr
Citext
Datetime
Inet
and $N others
= note: required for `{type error}` to implement `FromStaticSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text), Pg>`
= note: required for `{type error}` to implement `FromSqlRow<(diesel::sql_types::Integer, diesel::sql_types::Text), Pg>`
= note: required for `(diesel::sql_types::Integer, diesel::sql_types::Text)` to implement `load_dsl::private::CompatibleType<{type error}, Pg>`
= note: required for `BoxedSelectStatement<'_, (diesel::sql_types::Integer, diesel::sql_types::Text), FromClause<users::table>, Pg>` to implement `LoadQuery<'_, diesel::PgConnection, {type error}>`
note: required by a bound in `diesel::RunQueryDsl::load`
--> $DIESEL/src/query_dsl/mod.rs
|
| fn load<'query, U>(self, conn: &mut Conn) -> QueryResult<Vec<U>>
| ---- required by a bound in this associated function
| where
| Self: LoadQuery<'query, Conn, U>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::load`
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ note: `posts::table` is defined in module `crate::posts` of the current crate
15 | | posts (user_id) {
16 | | user_id -> Integer,
17 | | title -> Text,
18 | | body -> Nullable<Text>,
19 | | }
... |
20 | | }
| |_^
note: required by a bound in `InsertStatement::<T, diesel::query_builder::insert_statement::insert_from_select::InsertFromSelect<U, C>, Op, Ret>::into_columns`
Expand Down Expand Up @@ -127,8 +126,7 @@ note: `posts::table` is defined in module `crate::posts` of the current crate
15 | | posts (user_id) {
16 | | user_id -> Integer,
17 | | title -> Text,
18 | | body -> Nullable<Text>,
19 | | }
... |
20 | | }
| |_^
= note: required for `(comments::columns::post_id, comments::columns::body)` to implement `diesel::query_builder::insert_statement::column_list::ColumnList`
Expand Down Expand Up @@ -168,8 +166,7 @@ note: `posts::table` is defined in module `crate::posts` of the current crate
15 | | posts (user_id) {
16 | | user_id -> Integer,
17 | | title -> Text,
18 | | body -> Nullable<Text>,
19 | | }
... |
20 | | }
| |_^
= note: required for `(comments::columns::post_id, comments::columns::body)` to implement `diesel::query_builder::insert_statement::column_list::ColumnList`
Expand Down
36 changes: 34 additions & 2 deletions diesel_compile_tests/tests/fail/only_only_on_table.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ error[E0599]: the method `only` exists for struct `SelectStatement<FromClause<ta
| | public_fields(
| | select,
... |
| | )
| | )]
| |__- doesn't satisfy `_: OnlyDsl` or `_: Table`
|
Expand All @@ -36,7 +35,6 @@ error[E0599]: the method `only` exists for struct `SelectStatement<FromClause<ta
| | public_fields(
| | select,
... |
| | )
| | )]
| |__- doesn't satisfy `_: OnlyDsl` or `_: Table`
|
Expand Down Expand Up @@ -120,3 +118,37 @@ note: required by a bound in `diesel::RunQueryDsl::load`
| where
| Self: LoadQuery<'query, Conn, U>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::load`

error[E0277]: the trait bound `{type error}: FromSqlRow<(BigInt,), Sqlite>` is not satisfied
--> tests/fail/only_only_on_table.rs:19:28
|
19 | foo::table.only().load(&mut conn).unwrap();
| ---- ^^^^^^^^^ the trait `SingleValue` is not implemented for `(BigInt,)`
| |
| required by a bound introduced by this call
|
= note: double check your type mappings via the documentation of `(BigInt,)`
= note: `diesel::sql_query` requires the loading target to column names for loading values.
You need to provide a type that explicitly derives `diesel::deserialize::QueryableByName`
= help: the following other types implement trait `SingleValue`:
Array<ST>
BigInt
Bool
CChar
Cidr
Citext
Datetime
Inet
and $N others
= note: required for `{type error}` to implement `FromStaticSqlRow<(BigInt,), Sqlite>`
= note: required for `{type error}` to implement `FromSqlRow<(BigInt,), Sqlite>`
= note: required for `(BigInt,)` to implement `load_dsl::private::CompatibleType<{type error}, Sqlite>`
= note: required for `Only<foo::table>` to implement `LoadQuery<'_, diesel::SqliteConnection, {type error}>`
note: required by a bound in `diesel::RunQueryDsl::load`
--> $DIESEL/src/query_dsl/mod.rs
|
| fn load<'query, U>(self, conn: &mut Conn) -> QueryResult<Vec<U>>
| ---- required by a bound in this associated function
| where
| Self: LoadQuery<'query, Conn, U>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RunQueryDsl::load`
Loading
Loading