How to unpack an array of arrays with an RPC

It seems there's a lot of the documentation that assumes comfort and familiarity with PostgreSQL which makes sense, but for those of us who are being introduced to it for the first time through Supabase, I am having a hard time finding out how to do certain PostgreSQL things the "Supabase way"

For example, I have a situation where I'd like to tag a function parameter that is an array of arrays, and loop through it. Something along the lines of "Each of these arrays I am sending is a family of words, find at least one of these words in each"

['blue', 'red', 'green'] = blue OR red OR green
AND
['house', 'apartment', 'condo'] = house OR apartment OR condo

where a row containing blue AND apartment would work, or green AND condo, but not blue AND green and none of the second array, or vice versa.

Where's a good resource for learning how to craft these? More often than not examples I find online are for different versions of Postgres, take advantage of extensions I don't have, or have some other syntactical weirdness because I am using JSONB and it doesn't seem to want to cast in the same way as the person's example.

Are function parameters even optional? It seems like they aren't (not here, I mean in Postgres at large) and also that something like knowing that an array is empty and skipping it isn't either.

Strongly thinking about going to #jobs just to figure out how to craft certain things.
Was this page helpful?