[Need help] Handle joined tables filters #4455
Unanswered
SpencerMelo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Hi, I've being trying to properly use filters on joined tables, but did not found a way which feels correct, and need some direction.
Code
Given the following schema:
And consider I have a GET endpoint which allow filtering by table columns:
And the function entry looks like this:
So considering the function will get filter params like
filter_by=name&filter_term=hello
for all possible columns including joined, it should be able to map to the specific column type on which it should build the filterquery.filter(name.eq('blabla')
orquery.filter(title.eq('blabla')
, which can beVarchar
,Integer
,Timestampz
,Nullable<T>
.Initially, before having the joins, I just mapped the table fields, which worked well handling tables without joins, but now with joins Idk if there is a ergonomic way of handling it, other than mapping every single field for every single join in all services layers...
The current mapping I have is this:
Beta Was this translation helpful? Give feedback.
All reactions