Comparing version 1.0.2 to 1.0.3
30
mql.js
@@ -18,3 +18,4 @@ import { | ||
DUMP: false, | ||
LOG: false | ||
LOG: false, | ||
ERROR_WITH_SQL: false | ||
}; | ||
@@ -422,13 +423,18 @@ | ||
function base_query(excute_query, texts, values) { | ||
return go( | ||
_SQL(texts, values), | ||
replace_q, | ||
query => is_injection(query) ? Promise.reject('INJECTION ERROR') : query, | ||
tap(function(query) { | ||
if (MQL_DEBUG.DUMP) dump(query); | ||
typeof MQL_DEBUG.LOG == 'function' ? | ||
MQL_DEBUG.LOG(query) : (MQL_DEBUG.LOG && console.log(query)); | ||
}), | ||
excute_query); | ||
async function base_query(excute_query, texts, values) { | ||
try { | ||
var query = replace_q(_SQL(texts, values)); | ||
return await go( | ||
is_injection(query) ? Promise.reject('INJECTION ERROR') : query, | ||
tap(function(query) { | ||
if (MQL_DEBUG.DUMP) dump(query); | ||
typeof MQL_DEBUG.LOG == 'function' ? | ||
MQL_DEBUG.LOG(query) : (MQL_DEBUG.LOG && console.log(query)); | ||
}), | ||
excute_query); | ||
} catch (e) { | ||
MQL_DEBUG.ERROR_WITH_SQL && | ||
(e.stack = `\nMQL_DEBUG.ERROR_WITH_SQL:\n text: ${query.text}\n values: ${JSON.stringify(query.values)}\n${e.stack}`); | ||
throw e; | ||
} | ||
} | ||
@@ -435,0 +441,0 @@ |
{ | ||
"name": "mql2", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "query builder", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37977
678