Skip to content
Discussion options

You must be logged in to vote

Hey @k0shk0sh,

You can create function of your query and call it through supabase rpc.

create or replace function unblocked_users(name text) returns users as $$
  select * from users as t1 where LOWER(t1.name) like LOWER('%' || name || '%') 
  and not exists (select * from blocks as t2 where t2.blocked_id = t1.id) 
$$ language sql;
const { data, error } = await supabase
  .rpc('unblocked_users')
// with rpc, you can also use select() or other filters like eq()

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@k0shk0sh
Comment options

@k0shk0sh
Comment options

@k0shk0sh
Comment options

Answer selected by steve-chavez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants