I am looking for a way to put a constraint in place preventing access to data based on a site_uuid.
All the tables in my database would have a field site_uuid. Then I would ideally like to pass that site_uuid as a request header and essentially apply a where clause on every query checking the site_uuid is valid for the dataset return.
The idea is that its a shared database with multiple "sites". I understand scalability issues etc. This is not an issue in my case, the best approach is this multi-tenant approach if I can make it work.
I first hit this issue using the built-in _by_pk queries, when returning one object. I understand I can just use a where clause when returning a list of records.