From 70ee0a2c0af2c693fdaaabf88e69eef1e600a76b Mon Sep 17 00:00:00 2001 From: Tben Date: Tue, 29 Aug 2023 08:27:30 +0100 Subject: [PATCH] Updates --- engine/query/utils/addDbEntry.js | 2 +- engine/query/utils/updateDbEntry.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/query/utils/addDbEntry.js b/engine/query/utils/addDbEntry.js index 4add668..f50c56c 100644 --- a/engine/query/utils/addDbEntry.js +++ b/engine/query/utils/addDbEntry.js @@ -91,7 +91,7 @@ async function addDbEntry({ dbFullName, tableName, data, tableSchema, duplicateC if (targetFieldSchema?.pattern) { const pattern = new RegExp(targetFieldSchema.pattern, targetFieldSchema.patternFlags || ""); - if (!pattern.test(value)) { + if (!value?.toString()?.match(pattern)) { console.log("DSQL: Pattern not matched =>", value); value = ""; } diff --git a/engine/query/utils/updateDbEntry.js b/engine/query/utils/updateDbEntry.js index 2531b5b..5907e7e 100644 --- a/engine/query/utils/updateDbEntry.js +++ b/engine/query/utils/updateDbEntry.js @@ -83,7 +83,7 @@ async function updateDbEntry({ dbContext, paradigm, dbFullName, tableName, data, if (targetFieldSchema?.pattern) { const pattern = new RegExp(targetFieldSchema.pattern, targetFieldSchema.patternFlags || ""); - if (!pattern.test(value)) { + if (!value?.toString()?.match(pattern)) { console.log("DSQL: Pattern not matched =>", value); value = ""; } diff --git a/package.json b/package.json index b6b1ca8..6a301f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasquirel", - "version": "1.8.9", + "version": "1.9.0", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {