From ae1ccbd6295b183a3e6b50e2012ebdfcebdf3035 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Fri, 9 Feb 2024 07:00:17 +0100 Subject: [PATCH] add dsvgo querries --- data/newqueerys.surrealql | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/data/newqueerys.surrealql b/data/newqueerys.surrealql index f4b67a4..00ef9cd 100644 --- a/data/newqueerys.surrealql +++ b/data/newqueerys.surrealql @@ -1,4 +1,4 @@ -# Find ingridents included in recipe +# Find ingredients included in recipe SELECT ingredient.designation AS Ingredient FROM RecipeContainsIngredients WHERE recipe.name = 'Tomato Basil Salad'; # get Ingredients where carbohydrates are lower than 40 @@ -19,8 +19,6 @@ FROM SupplierContainsIngredients GROUP BY supplier; - - # Stock low warning DEFINE EVENT ingredient_stock_low ON TABLE Ingredient WHEN $after.stock < 10 THEN ( @@ -28,3 +26,14 @@ WHEN $after.stock < 10 THEN ( ingredient_id = $value.id, created_at = time::now() ); + +# User Data Exporting +LET $customer = 'd.foede@web.de'; +SELECT *, address.*, (SELECT * FROM Order WHERE customer.email = $customer) AS orders FROM Customer WHERE email = $customer; + +# Delete User Data +LET $customer = SELECT id FROM Customer WHERE email = 'd.foede@web.de'; +DELETE $customer.address; +DELETE OrderContainsIngredients WHERE order.customer = $customer; +DELETE Order WHERE customer = $customer; +DELETE $customer; \ No newline at end of file