From 03b0c18ed01d60a183543a67530d24cda3275c5c Mon Sep 17 00:00:00 2001 From: root Date: Tue, 6 Dec 2022 11:02:56 +0000 Subject: [PATCH] ISSUE-63: Delete added Regex pattern from database --- Docker_Project/README.md | 6 ++++++ .../Resql/templates/production/delete_regex.sql | 1 + Docker_Project/Ruuter/DSL/GET/delete_regex.yml | 9 +++++++++ 3 files changed, 16 insertions(+) create mode 100644 Docker_Project/Resql/templates/production/delete_regex.sql create mode 100644 Docker_Project/Ruuter/DSL/GET/delete_regex.yml diff --git a/Docker_Project/README.md b/Docker_Project/README.md index 64d8d58..17a9a2c 100644 --- a/Docker_Project/README.md +++ b/Docker_Project/README.md @@ -32,3 +32,9 @@ https://github.com/buerokratt/Data-Anonymizer/issues/69 https://github.com/buerokratt/Data-Anonymizer/issues/86 Add [Ruuter DSL File](Ruuter/DSL/GET/regex.yml) and [Resql Query](Resql/templates/production/list_regex.sql) to list regex patterns. + +### Delete added Regex pattern from database + +https://github.com/buerokratt/Data-Anonymizer/issues/63 + +Add [Ruuter DSL File](Ruuter/DSL/GET/delete_regex.yml) and [Resql Query](Resql/templates/production/delete_regex.sql) to delete a regex pattern. diff --git a/Docker_Project/Resql/templates/production/delete_regex.sql b/Docker_Project/Resql/templates/production/delete_regex.sql new file mode 100644 index 0000000..ac1c879 --- /dev/null +++ b/Docker_Project/Resql/templates/production/delete_regex.sql @@ -0,0 +1 @@ +insert into Regex_Entity (id, regex, entity, active) select id, regex, entity, False from Regex_Entity where id = :id ORDER BY created_at DESC limit 1; \ No newline at end of file diff --git a/Docker_Project/Ruuter/DSL/GET/delete_regex.yml b/Docker_Project/Ruuter/DSL/GET/delete_regex.yml new file mode 100644 index 0000000..8d0793e --- /dev/null +++ b/Docker_Project/Ruuter/DSL/GET/delete_regex.yml @@ -0,0 +1,9 @@ +delete_regex: + call: http.post + args: + url: http://resql:8082/delete_regex + body: + id: ${parseInt(incoming.params.id)} + +return_value: + return: "success"