From a3b38ea494cb41aeaf5aff935a458c0de998ba8a Mon Sep 17 00:00:00 2001 From: Ali Demirci Date: Thu, 7 Oct 2021 01:39:09 +0300 Subject: [PATCH] fix(fieldParsing): unable to parse column names with ` for example if an insert query has column names wrapped with ``` it will not be able to parse object keys. currently it parses them like `"`column`"` instead it should be just `"column"` --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 7d835aa..aa55591 100644 --- a/index.js +++ b/index.js @@ -418,7 +418,7 @@ class QueryCursor { if (isFirstElObject) { let m = query.match(/INSERT INTO (.+?) \((.+?)\)/); if (m) { - fieldList = m[2].split(',').map(s => s.trim()); + fieldList = m[2].split(',').map(s => s.trim().split('`').join('')); } else { throw new Error('insert query wasnt parsed field list after TABLE_NAME'); }