node-sql-parser
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -276,6 +276,6 @@ 'use strict' | ||
if (has(stmt, 'where') && stmt.where !== null) clauses.push(`WHERE ${exprToSQL(stmt.where)}`) | ||
if (Array.isArray(stmt.groupby)) clauses.push('GROUP BY', getExprListSQL(stmt.groupby).join(', ')) | ||
if (Array.isArray(stmt.groupby) && stmt.groupby.length > 0) clauses.push('GROUP BY', getExprListSQL(stmt.groupby).join(', ')) | ||
if (has(stmt, 'having') && stmt.having !== null) clauses.push(`HAVING ${exprToSQL(stmt.having)}`) | ||
if (Array.isArray(stmt.orderby)) { | ||
if (Array.isArray(stmt.orderby) && stmt.orderby.length > 0) { | ||
const orderExpressions = stmt.orderby.map(expr => `${exprToSQL(expr.expr)} ${expr.type}`) | ||
@@ -282,0 +282,0 @@ clauses.push('ORDER BY', orderExpressions.join(', ')) |
{ | ||
"name": "node-sql-parser", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "simple node sql parser", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,3 +17,3 @@ # Nodejs SQL Parser | ||
[![TypeScript definitions on DefinitelyTyped](http://definitelytyped.org/badges/standard.svg)](http://definitelytyped.org) | ||
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/taozhi8833998/node-sql-parser/blob/master/LICENSE) | ||
[![license](https://img.shields.io/badge/license-GPLv2-blue.svg)](https://github.com/taozhi8833998/node-sql-parser/blob/master/LICENSE) | ||
@@ -20,0 +20,0 @@ **Parse simple SQL statements into an abstract syntax tree (AST) with the visited tableList, columnList and convert it back to SQL.** |
Sorry, the diff of this file is too big to display
355221
12091