Many-to-many relationship not through linking table #24134
Labels
kind/feature
A request for a new feature.
team/client
Issue for team Client.
team/schema
Issue for team Schema.
topic: joins
topic: relations
Problem
Give tables
a
andb
, wherea{id, linking_id}
andb{id, linking_id}
, andlinking_id
is non-unique in both tables, it is impossible to define this relationship using prisma, and thus impossible to query it normally.In a SQL query, this is obviously trivial:
Suggested solution
Allow a relationship to be defined in the schema specifying this sort of many-to-many relationships, possibly:
Additional context
Although there are workaround via raw sql, those are not composable with code that generates filtering queries and the like using prisma's standard syntax.
The text was updated successfully, but these errors were encountered: