DT
Drizzle Team•2mo ago
pato

How to register triggers, events and functions

Since Drizzle doesn't offer support for defining triggers, events or functions, what is the best way to register these? For example, a developer is setting up locally the project's database. Drizzle can handle tables and other things thanks to the schema, but if the database needs to have certain triggers and events registered beforehand, what would be the best way to set it up?
1 Reply
rphlmr âš¡
rphlmr ⚡•2mo ago
Personal practice: I use Supabase. On some projects, I need to enable RLS or add some policies, create some trigger functions, etc. I write and test them with their UI on a dev DB (I am not a SQL expert 😅) and then I copy the code into a Drizzle custom migration. drizzle-kit generate --custom