top | item 36443022

(no title)

RedCrowbar | 2 years 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. Future versions will add support for causing effects outside of the database, e.g. call a WebHook or some such.

discuss

order

No comments yet.