New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.2 to 1.3.3

18

lib/sql.js

@@ -17,3 +17,3 @@ 'use strict'

const surportedTypes = ['select', 'delete', 'update', 'insert', 'drop', 'rename', 'truncate', 'call']
const surportedTypes = ['select', 'delete', 'update', 'insert', 'drop', 'rename', 'truncate', 'call', 'use']

@@ -38,2 +38,7 @@ function escape(str) {

function getSemiColon(semicolon = '') {
if (semicolon === null) semicolon = ''
return semicolon
}
function literalToSQL(literal) {

@@ -364,3 +369,4 @@ const { type } = literal

clauses.push(str)
return clauses.join(' ')
const semicolon = getSemiColon(stmt.semicolon)
return `${clauses.join(' ')}${semicolon}`
}

@@ -386,2 +392,9 @@

function useToSQL(stmt) {
const type = stmt.type && stmt.type.toUpperCase()
const database = identifierToSql(stmt.db)
const semicolon = getSemiColon(stmt.semicolon)
return `${type} ${database}${semicolon}`
}
function callToSQL(stmt) {

@@ -420,2 +433,3 @@ const type = 'CALL'

truncate : dropAndTruncateToSQL,
use : useToSQL,
rename : renameToSQL,

@@ -422,0 +436,0 @@ call : callToSQL,

2

package.json
{
"name": "node-sql-parser",
"version": "1.3.2",
"version": "1.3.3",
"description": "simple node sql parser",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -65,27 +65,19 @@ # Nodejs SQL Parser

{
"tableList": [
"select::null::t"
"with": null,
"type": "select",
"options": null,
"distinct": null,
"columns": "*",
"from": [
{
"db": null,
"table": "t",
"as": null
}
],
"columnList": [
"select::null::(.*)"
],
"ast": {
"with": null,
"type": "select",
"options": null,
"distinct": null,
"columns": "*",
"from": [
{
"db": null,
"table": "t",
"as": null
}
],
"where": null,
"groupby": null,
"having": null,
"orderby": null,
"limit": null
}
"where": null,
"groupby": null,
"having": null,
"orderby": null,
"limit": null
}

@@ -105,3 +97,3 @@ ```

### TableList, ColumnList, Ast
### Get TableList, ColumnList, Ast by `parse` function

@@ -108,0 +100,0 @@ ```javascript

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