Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-sql-parser

Package Overview
Dependencies
Maintainers
1
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-sql-parser - npm Package Compare versions

Comparing version 1.3.3 to 1.3.4

24

lib/sql.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc