field unique and occasionally make a select request to see whether such username is occupied. But if someone fakes a client, they could bypass that step.
As I'm writing this, Im thinking I should probably setup a trigger that BEFORE the insertion it runs a function that checks whether a user with that username exists. Although not sure if insertion can be cancelled this way. Is that a possibilty?
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.