Comments (5)
Thanks for providing the minimal example. That's helpful. I will try to have a look at that in the next days/weeks.
from diesel.
I can confirm this issue. This also affects queries like users::table.order_by(persons::age).select(persons::age)
. These queries are not allowed without additional group by clause by postgresql and should be rejected at compile time by diesel. That likely means that we need to restrict the order clause values in a similar way than we already do for select clauses. I personally would consider that a bug fix even if this breaks code that would compile now (especially as the generated queries are broken).
To workaround this kind of issue on current diesel releases you need to not write queries that mix non-aggregate and aggregate clauses in this way. So either add a group_by clause or remove the order clause.
from diesel.
Thanks for filling this bug report. Its always a lot of work to find problems in applications, especially if the it requires several steps and a lot unrelated dependencies. Please try to provide a minimized example that does not required additional dependencies outside of diesel and rust-stdlib, otherwise this issue is not really actionable.
from diesel.
Thanks for filling this bug report. Its always a lot of work to find problems in applications, especially if the it requires several steps and a lot unrelated dependencies. Please try to provide a minimized example that does not required additional dependencies outside of diesel and rust-stdlib, otherwise this issue is not really actionable.
@weiznich I added a minimal project: https://gitlab.com/samtv12345/diesel-issue3815 . The only dependency it includes is dotenv for having a single DATABASE_URL
from diesel.
Thanks for the help <3. Sorry for misreading the last checkbox. I thought a third party crate would be related to diesel, not in general.
from diesel.
Related Issues (20)
- `.distinct_on` is limited to maximum three `.order_by`s HOT 2
- fix: `sql_query` error "`Untyped: CompatibleType<std::string::String, Pg>` is not satisfied" HOT 1
- Impossible to combine into_boxed and group_by
- Impossible to combine into_boxed and group_by
- Failed to save array of enums HOT 3
- Nullable<diesel::sqlite::sql_types::Timestamptz> throws trait not implement errors
- Segmentation Fault in R2D2 postgres (interrupted by signal 11: SIGSEGV) HOT 10
- `joinable!` is not generated for two foreign keys referencing the same table HOT 1
- Diesel-cli Can't connect to local MySQL server through socket '/tmp/mysql.sock' HOT 1
- Deserialization layer seems too permissive with regards to checking the actual types received HOT 1
- Can't use `into_boxed` after union HOT 1
- table have more than one primary_key can not use on_conflict(diesel::dsl::DuplicatedKeys) HOT 7
- No intellisense when using query dsl HOT 6
- `overflow evaluating the requirement` when writing generic diesel code HOT 1
- Pagination guide doesn't work on entity represented by joined tables HOT 2
- losing type information when adding WHERE (filter) clause to query HOT 2
- Diesel not generate joinable when there are 2 foreign keys reference same field HOT 1
- `#[derive(AsExpression, FromSqlRow)]` won't compile when generic bounds have a default implementation. HOT 2
- Serials keep incrementing despite begin_test_transaction HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diesel.