From 303d958042ce714886f15a07f548c725f7eded77 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 20 Jun 2022 16:53:58 +0800 Subject: [PATCH] refactor: put sanitize to helpers --- .../src/lib/db/sql-data-mapper/lib/sql/helpers/sanitize.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/sanitize.ts diff --git a/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/sanitize.ts b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/sanitize.ts new file mode 100644 index 0000000000..f52d6666ad --- /dev/null +++ b/packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/sanitize.ts @@ -0,0 +1,7 @@ +export function sanitize(v) { + return v?.replaceAll('?', '\\\\?'); +} + +export function unsanitize(v) { + return v?.replaceAll('\\?', '?'); +}