Does anybody here know solution to this? I have th...
# help
k
Does anybody here know solution to this? I have this exact same problem and nobody has answered to this on stackoverflow. https://stackoverflow.com/questions/70699495/supabase-filter-data-with-join-and-logical-or
n
Hello @Kadnium! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
s
You can create a Postgres function and pass in the argument you wish to search for. You could then call this from the supabase-js library by using the
.rpc
call.
n
Kadnium (2022-05-02)
k
Yeah I thought of that but if I need paging or other things like that I need to implement them in SQL
Theres no way in doing this in supabase js?
s
Not that I know of, but maybe someone with more knowledge of this than me will chime in
g
So if you are wanting a result if either table contains something then no. You can do an or filter on a foreign table and another or filter on the main table but they are anded together. A single or filter must all be on the same table.
k
ok thanks
n
Thread was archived by @Kadnium. Anyone can send a message to unarchive it.
s
> Yeah I thought of that but if I need paging or other things like that I need to implement them in SQL > @Kadnium Note that if your function returns a SETOF you can use all the same filters that
select
supports : https://supabase.com/docs/reference/javascript/rpc#with-filters
k
ok thanks for this, this will solve the problem then