node-sql-parser
Advanced tools
Comparing version 1.3.3 to 1.3.4
@@ -37,7 +37,2 @@ 'use strict' | ||
function getSemiColon(semicolon = '') { | ||
if (semicolon === null) semicolon = '' | ||
return semicolon | ||
} | ||
function literalToSQL(literal) { | ||
@@ -304,8 +299,11 @@ const { type } = literal | ||
const clauses = ['DELETE'] | ||
if (stmt.columns === '*') clauses.push('*') | ||
else columnsToSQL(stmt.columns, stmt.from) && clauses.push(columnsToSQL(stmt.columns, stmt.from)) | ||
const { columns, from, tables, where } = stmt | ||
if (columns === '*') clauses.push('*') | ||
else columnsToSQL(columns, from) && clauses.push(columnsToSQL(columns, from)) | ||
if (Array.isArray(stmt.tables)) clauses.push(tablesToSQL(stmt.tables)) | ||
if (Array.isArray(stmt.from)) clauses.push('FROM', tablesToSQL(stmt.from)) | ||
if (has(stmt, 'where') && stmt.where !== null) clauses.push(`WHERE ${exprToSQL(stmt.where)}`) | ||
if (Array.isArray(tables)) { | ||
if (!(tables.length === 1 && tables[0].addition === true)) clauses.push(tablesToSQL(tables)) | ||
} | ||
if (Array.isArray(from)) clauses.push('FROM', tablesToSQL(from)) | ||
if (has(stmt, 'where') && where !== null) clauses.push(`WHERE ${exprToSQL(where)}`) | ||
@@ -369,4 +367,3 @@ return clauses.join(' ') | ||
clauses.push(str) | ||
const semicolon = getSemiColon(stmt.semicolon) | ||
return `${clauses.join(' ')}${semicolon}` | ||
return `${clauses.join(' ')}` | ||
} | ||
@@ -395,4 +392,3 @@ | ||
const database = identifierToSql(stmt.db) | ||
const semicolon = getSemiColon(stmt.semicolon) | ||
return `${type} ${database}${semicolon}` | ||
return `${type} ${database}` | ||
} | ||
@@ -399,0 +395,0 @@ |
{ | ||
"name": "node-sql-parser", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"description": "simple node sql parser", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
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
377513
12956