You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks so much for a great project.
While working with a feature to sum all the user_transactions and create a statistics by date, I have a problem with the group_by function that I don't find any solution on the internet. Please help.
.select((
| ^^^^^^ the trait IsContainedInGroupBy<user_transactions::columns::created_at> is not implemented for functions::date_and_time::date::date<user_transactions::columns::created_at>
--> app/src/repository/user_transaction.rs:48:10
|
48 | .select((
| ^^^^^^ the trait IsContainedInGroupBy<user_transactions::columns::created_at> is not implemented for functions::date_and_time::date::date<user_transactions::columns::created_at>
|
= help: the following other types implement trait IsContainedInGroupBy<T>:
<withdrawals::columns::updated_at as IsContainedInGroupBywithdrawals::columns::updated_at>
<withdrawals::columns::updated_at as IsContainedInGroupBywithdrawals::columns::created_at>
<withdrawals::columns::updated_at as IsContainedInGroupBywithdrawals::columns::notes>
<withdrawals::columns::updated_at as IsContainedInGroupBywithdrawals::columns::status>
<withdrawals::columns::updated_at as IsContainedInGroupBywithdrawals::columns::amount>
<withdrawals::columns::updated_at as IsContainedInGroupBywithdrawals::columns::user_id>
<withdrawals::columns::updated_at as IsContainedInGroupBywithdrawals::columns::id>
<withdrawals::columns::created_at as IsContainedInGroupBywithdrawals::columns::updated_at>
and 1428 others
note: required for user_transactions::columns::created_at to implement ValidGrouping<functions::date_and_time::date::date<user_transactions::columns::created_at>>
--> app/src/schema.rs:316:9
|
316 | created_at -> Timestamp,
| ^^^^^^^^^^
= note: 1 redundant requirement hidden
= note: required for (sum<Integer, cash>, date<created_at>) to implement ValidGrouping<functions::date_and_time::date::date<user_transactions::columns::created_at>>
= note: the full type name has been written to '/app/target/debug/deps/app-8840f9eb5889a010.long-type-1122692697415527159.txt'
= note: required for SelectStatement<FromClause<table>, DefaultSelectClause<FromClause<table>>, ..., ..., ..., ..., ...> to implement SelectDsl<(functions::aggregate_folding::sum::sum<diesel::sql_types::Integer, user_transactions::columns::cash>, functions::date_and_time::date::date<user_transactions::columns::created_at>)>
= note: the full type name has been written to '/app/target/debug/deps/app-8840f9eb5889a010.long-type-17702273429917501699.txt'
Thanks for filling this Bug report.
I fear that this is currently just not supported by the built-in DSL. We certainly would accept a PR that extends what is possible to express in terms of valid GROUP BY clauses.
Setup
Versions
Feature Flags
Problem Description
Thanks so much for a great project.
While working with a feature to sum all the user_transactions and create a statistics by date, I have a problem with the group_by function that I don't find any solution on the internet. Please help.
Thanks so much
This code does not compile :
What are you trying to accomplish?
What is the expected output?
What is the actual output?
Are you seeing any additional errors?
Steps to reproduce
Checklist
closed if this is not the case)
The text was updated successfully, but these errors were encountered: