Grant Privileges to Role
I created roles in my project using the
pgRole()
in order to enable RLS on my database. After running the migration my user has no privileges on my tables and cannot access them. How can I grant all privileges to my role?3 Replies
Did you ever figure this out?
Because the only thing I can think of is manually adding this to migrations
One last attempt ping, I hope you see this and have an answer 😅 I have a solution now, but I don't like it.
Must add something like
GRANT SELECT, INSERT, UPDATE, DELETE ON table_name TO role;
in one of your migration files. There seems to be no other way.Yeah this ^ ... I very much treat the generated migrations as just a starter.
Most of them we have to tweak manually ... a bunch is because we lean heavily on postgres features that Drizzle doesn't support natively. But also, we could use RLS before drizzle supported it because we just added it to the migrations.
Maybe because my team comes from a database-first background, this just seems normal to us