Is there any way to access auth object in postgres functions?

Hey!

wondering if there's a way to access auth object inside postgres function that's being called via RPC just like we're accessing auth.uid() in e.g. RLS policies. If the answer is yes, it's possible maybe you also know a way how to access it using plv8 language for writing those functions? Maybe there's a reserved word for it

As a side question: are there any drawbacks in using .rpc() instead of .select() all the way through? (Just like endpoints and perform all the validations, checks, etc. there)
Was this page helpful?