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
{{ message }}
Repository navigation
Preview feature feedback: Order by Relations support (orderByRelation) #5438
changed the title [-]Preview feature feedback: Order by Relations support (`orderByRelations`)[/-][+]Preview feature feedback: Order by Relations support (`orderByRelation`)[/+]on Mar 10, 2021
The feature is working great, but if it could not only count the number of relations, but also sum, avg, min and max some specific attribute of the relations, it would make it a killer feature.
I prepare a simple project. There are 3 entities with composite keys. The last entity (TASK) has reference to Company and Project. I Can order tasks by CompanyName, but I cannot order them by ProjectName.
prismaClientUnknownRequestError2 [PrismaClientUnknownRequestError]: Invalidprisma.task.findMany() invocation: Error occurred during query execution: ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Error { kind: Db, cause: Some(DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState("42804"), message: "argument of JOIN/ON must be type boolean, not type record", detail: None, hint: None, position: Some(Original(383)), where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("parse_coerce.c"), line: Some(1156), routine: Some("coerce_to_boolean") }) }) }) at cb (/prisma-schema-orderby/node_modules/@prisma/client/runtime/index.js:35105:17) at processTicksAndRejections (internal/process/task_queues.js:93:5) { clientVersion: '2.23.0' }
For me it doesn't work very well with skip. Not that this is a bug, but when the relation has the same quantity the order of the objects in the response may vary. I think this will only be solved when it becomes possible to sort by multiple fields
Activity
[-]Preview feature feedback: Order by Relations support (`orderByRelations`)[/-][+]Preview feature feedback: Order by Relations support (`orderByRelation`)[/+]guerrerocarlos commentedon Apr 23, 2021
The feature is working great, but if it could not only count the number of relations, but also
sum,avg,minandmaxsome specific attribute of the relations, it would make it a killer feature.For example, a very common use case:
Top 10 students with the best grades
Brandejs commentedon May 27, 2021
Hi,
I prepare a simple project. There are 3 entities with composite keys. The last entity (TASK) has reference to Company and Project. I Can order tasks by CompanyName, but I cannot order them by ProjectName.
prismaClientUnknownRequestError2 [PrismaClientUnknownRequestError]: Invalidprisma.task.findMany()invocation: Error occurred during query execution: ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Error { kind: Db, cause: Some(DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState("42804"), message: "argument of JOIN/ON must be type boolean, not type record", detail: None, hint: None, position: Some(Original(383)), where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("parse_coerce.c"), line: Some(1156), routine: Some("coerce_to_boolean") }) }) }) at cb (/prisma-schema-orderby/node_modules/@prisma/client/runtime/index.js:35105:17) at processTicksAndRejections (internal/process/task_queues.js:93:5) { clientVersion: '2.23.0' }ISSUE: #7331
janpio commentedon May 28, 2021
Can you split that into a new issue @Brandejs and also include the information asked for in the bug report template? That would be awesome. Thanks!
andresribeiro commentedon Jun 27, 2021
For me it doesn't work very well with skip. Not that this is a bug, but when the relation has the same quantity the order of the objects in the response may vary. I think this will only be solved when it becomes possible to sort by multiple fields
2color commentedon Sep 7, 2021
Closing this now that this has been released to General Availability in the 3.0.1 release