Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small event improvements #1094

Merged
merged 3 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading