From b339f30b3ff09a52dc079fec361da3cee4dfa1c8 Mon Sep 17 00:00:00 2001 From: Dave MacLeod <56599343+Dhghomon@users.noreply.github.com> Date: Fri, 3 Jan 2025 09:56:54 +0900 Subject: [PATCH 1/3] Note the three possible events --- src/content/doc-surrealql/parameters.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/doc-surrealql/parameters.mdx b/src/content/doc-surrealql/parameters.mdx index cf25b8356..482ec8193 100644 --- a/src/content/doc-surrealql/parameters.mdx +++ b/src/content/doc-surrealql/parameters.mdx @@ -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 either "CREATE", "UPDATE", or "DELETE". ```surql DEFINE EVENT user_created ON TABLE user WHEN $event = "CREATE" THEN ( From fcd130086b8b09f56e5d75ef66948fd4e0052ced Mon Sep 17 00:00:00 2001 From: Dave MacLeod <56599343+Dhghomon@users.noreply.github.com> Date: Fri, 3 Jan 2025 09:57:05 +0900 Subject: [PATCH 2/3] Fix an incomplete sentence --- src/content/doc-surrealql/statements/delete.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/doc-surrealql/statements/delete.mdx b/src/content/doc-surrealql/statements/delete.mdx index 25fa1e50b..f11918e00 100644 --- a/src/content/doc-surrealql/statements/delete.mdx +++ b/src/content/doc-surrealql/statements/delete.mdx @@ -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 { From 1ce7639ef6b2d12c79cf2b938c9b36a878dbeeea Mon Sep 17 00:00:00 2001 From: Dave MacLeod <56599343+Dhghomon@users.noreply.github.com> Date: Fri, 3 Jan 2025 10:21:04 +0900 Subject: [PATCH 3/3] Codeblockify --- src/content/doc-surrealql/parameters.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/doc-surrealql/parameters.mdx b/src/content/doc-surrealql/parameters.mdx index 482ec8193..1b887bc39 100644 --- a/src/content/doc-surrealql/parameters.mdx +++ b/src/content/doc-surrealql/parameters.mdx @@ -109,7 +109,7 @@ DEFINE TABLE user SCHEMAFULL ### $event -Represents the type of table event triggered on an event. This parameter will be either "CREATE", "UPDATE", or "DELETE". +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 (