-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
It would be a very useful feature if it were possible to include schema relations based on the values of an array column. This would make one-to-many relationships very simple to add, not even requiring a table for the sole purpose of joining. Here's an example of what this could look like with rqbv2:
export const relations = defineRelations({ persons, results }, (r) => ({
results: {
persons: r.many.persons({
from: r.results.personIds, // array of numbers
to: r.persons.personId, // number field
}),
},
}));I tried using this code, but when I actually try to include this relation in a query, I get this error: No operator matches the given name and argument types. You might need to add explicit type casts.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request