Skip to content

Commit

Permalink
Small event improvements (#1094)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhghomon authored Jan 3, 2025
1 parent 98aea8d commit 4ce0b98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/content/doc-surrealql/parameters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ DEFINE TABLE user SCHEMAFULL

### $event

Represents the type of table event triggered on an event.
Represents the type of table event triggered on an event. This parameter will be one of either `"CREATE"`, `"UPDATE"`, or `"DELETE"`.

```surql
DEFINE EVENT user_created ON TABLE user WHEN $event = "CREATE" THEN (
Expand Down
2 changes: 1 addition & 1 deletion src/content/doc-surrealql/statements/delete.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ DELETE person:tobie->bought WHERE out=product:iphone;

While soft deletions do not exist natively in SurrealDB, they can be simulated by [defining an event](/docs/surrealql/statements/define/event) that reacts whenever a deletion occurs.

The following example archives the data of a deleted record in another table so that it is
The following example archives the data of a deleted record in another table. This can be combined with [fewer permissions for the new table](/docs/surrealql/statements/define/table#defining-permissions) so that it can be accessed only by [system users](/docs/surrealql/statements/define/user) and not [record users](/docs/surrealql/statements/define/access/record).

```surql
DEFINE EVENT archive_person ON TABLE person WHEN $event = "DELETE" THEN {
Expand Down

0 comments on commit 4ce0b98

Please sign in to comment.