Query profile data on Supabase to trigger an action

Is there a way to query a row item in Supabase with a set of inputs. i.e a user selects their profile from a list and manually enters a pin-code. If the pin is correct a workflow is triggered, if it’s incorrect an error alert is returned.

I think retrieving the pin-code with a collection of profiles would be unsecure and it’d be better handled on the backend, but I don’t know how to do that.

You could simplify this to just PIN codes, if it’s not that each user (that is gonna access profiles) will be unique for each user.

If the PIN is unique just for the profile, so for example user1 and user2 will have to use the PIN: BrobertoIsAwesome420 to access profile belonging to Broberto's profile, then you can make simply one table, having the data of the profile, and also the PIN. Then based on the PIN, you will just do a simple SELECT WHERE profile.pin = 'BrobertoIsAwesome420'

Otherwise, what you’re looking for is Supabase Postgres Function, or Fastgen.