Add string query Formatter
This commit is contained in:
parent
6056646122
commit
5d56d41624
@ -89,9 +89,14 @@ async function runQuery({
|
||||
*/
|
||||
try {
|
||||
if (typeof query === "string") {
|
||||
const formattedQuery = query
|
||||
.replace(/\n|\r|\n\r|\r\n/gm, " ")
|
||||
.replace(/ {2,}/g, " ")
|
||||
.trim();
|
||||
|
||||
if (local) {
|
||||
const rawResults = await LOCAL_DB_HANDLER(
|
||||
query,
|
||||
formattedQuery,
|
||||
queryValuesArray
|
||||
);
|
||||
result = tableSchema
|
||||
@ -102,14 +107,14 @@ async function runQuery({
|
||||
: rawResults;
|
||||
} else if (readOnly) {
|
||||
result = await varReadOnlyDatabaseDbHandler({
|
||||
queryString: query,
|
||||
queryString: formattedQuery,
|
||||
queryValuesArray,
|
||||
database: dbFullName,
|
||||
tableSchema,
|
||||
});
|
||||
} else {
|
||||
result = await fullAccessDbHandler({
|
||||
queryString: query,
|
||||
queryString: formattedQuery,
|
||||
queryValuesArray,
|
||||
database: dbFullName,
|
||||
tableSchema,
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@moduletrace/datasquirel",
|
||||
"version": "2.6.8",
|
||||
"version": "2.6.9",
|
||||
"description": "Cloud-based SQL data management tool",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
|
Loading…
Reference in New Issue
Block a user