Natively write SQL functions/triggers with Drizzle?
Is it possible to, for example, write this kind of logic directly in Drizzle's schema?
6 Replies
bump
don't think so. Bump anyways
bump
No, this would require a custom migration
this is basically adding a constraint tho
if u read the function's body, it's preventing a new row from being created if a certain condition
I was gonna swear I've seen native drizzle code for that but I cant remember where
@pato see the Check option here if it fits your needs https://orm.drizzle.team/docs/indexes-constraints#check
Drizzle ORM - Indexes & Constraints
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.