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.6.6 to 1.6.7

6

index.d.ts

@@ -73,5 +73,5 @@ // Type definitions for node-sql-parser 1.0

export interface Update {
type: 'udpate';
type: 'update';
db: string | null;
table: string;
table: Array<From | Dual> | null;
set: SetList[];

@@ -82,3 +82,3 @@ where: any;

type: 'delete';
tables: any;
table: any;
from: Array<From | Dual>;

@@ -85,0 +85,0 @@ where: any;

@@ -13,3 +13,13 @@ "use strict";

const str = expr.target.length ? `(${expr.target.length})` : '';
return `CAST(${(0, _expr.exprToSQL)(expr.expr)} AS ${expr.target.dataType}${str})`;
let prefix = (0, _expr.exprToSQL)(expr.expr);
let symbol = '::';
let suffix = '';
if (expr.symbol === 'as') {
prefix = `CAST(${prefix}`;
suffix = ')';
symbol = ` ${expr.symbol.toUpperCase()} `;
}
return `${prefix}${symbol}${expr.target.dataType}${str}${suffix}`;
}

@@ -16,0 +26,0 @@

@@ -14,3 +14,6 @@ "use strict";

var _select = require("./select");
function valuesToSQL(values) {
if (values.type === 'select') return (0, _select.selectToSQL)(values);
const clauses = values.map(_expr.exprToSQL);

@@ -29,5 +32,5 @@ return `(${clauses.join('),(')})`;

if (Array.isArray(columns)) clauses.push(`(${columns.map(_util.identifierToSql).join(', ')})`);
clauses.push((0, _util.commonOptionConnector)('VALUES', valuesToSQL, values));
clauses.push((0, _util.commonOptionConnector)(Array.isArray(values) ? 'VALUES' : '', valuesToSQL, values));
clauses.push((0, _util.commonOptionConnector)('WHERE', _expr.exprToSQL, where));
return clauses.filter(_util.hasVal).join(' ');
}

@@ -46,2 +46,3 @@ "use strict";

if (!opt) return;
if (!keyword) return action(opt);
return `${keyword.toUpperCase()} ${action(opt)}`;

@@ -48,0 +49,0 @@ }

{
"name": "node-sql-parser",
"version": "1.6.6",
"version": "1.6.7",
"description": "simple node sql parser",

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

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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