2 ms·
I am using Prisma in the production. I want to ask: - Can EdgeDB solve the problems like `soft-delete`? Prisma can't do this good, there are third-party packa
by meotimdihia 3y ago
I am using Prisma in the production. I want to ask:
- Can EdgeDB solve the problems like `soft-delete`? Prisma can't do this good, there are third-party packages, but I don't trust these packages because authors often drop support.
- How about hooks, for example, I want to trigger scripts after/before a record is added to the table.
- RedCrowbar 3y ago> Can EdgeDB solve the problems like `soft-delete`? Yes, with access policy rules. E.g global hide_deleted: bool; type SoftDeletable { deleted: bool; access policy hide_deleted allow all when (global hide_deleted) using (not .deleted); } The above will effectively "hide" objects with `.deleted` set to `true` from all queries when the `hide_deleted` global is set to true. > How about hooks, for example, I want to trigger scripts after/before a record is added to the table. EdgeDB supports triggers: https://www.edgedb.com/docs/changelog/3_x#triggers https://www.edgedb.com/docs/changelog/3_x#triggers. Future versions will add support for causing effects outside of the database, e.g. call a WebHook or some such.