Creating separate tables to limit update accesses to essential ressources sometimes leads to cases where we need on_create triggers to insert and relate required rows to main entities as well as before update and before delete triggers to protect said rows. This could be avoided by including these rows in the main entities tables, a thing we avoided to do initially to contain and control updatability with greater granularity.
Closing as this does not really apply to our current CRUD system. Drizzle does not currently support migrations for views nor implement the basis for using row level security policies based on auth users.
Task Description
Creating separate tables to limit update accesses to essential ressources sometimes leads to cases where we need
on_create
triggers to insert and relate required rows to main entities as well asbefore update
andbefore delete
triggers to protect said rows. This could be avoided by including these rows in the main entities tables, a thing we avoided to do initially to contain and control updatability with greater granularity.After more reading, it appears using
views
(withsecurity_invoker
?) would allow us to simplify the public schema. Read: https://github.com/orgs/supabase/discussions/901 for an example.List of actions