node-sql-parser
Advanced tools
Comparing version 1.7.1 to 1.7.2
@@ -29,5 +29,7 @@ "use strict"; | ||
orderby, | ||
limit | ||
limit, | ||
top | ||
} = stmt; | ||
const clauses = [(0, _with.withToSql)(withInfo), 'SELECT']; | ||
clauses.push((0, _util.topToSQL)(top)); | ||
if (Array.isArray(options)) clauses.push(options.join(' ')); | ||
@@ -34,0 +36,0 @@ clauses.push(distinct, (0, _column.columnsToSQL)(columns, from)); // FROM + joins |
@@ -21,2 +21,3 @@ "use strict"; | ||
exports.toUpper = toUpper; | ||
exports.topToSQL = topToSQL; | ||
exports.DEFAULT_OPT = void 0; | ||
@@ -166,2 +167,13 @@ | ||
function topToSQL(opt) { | ||
if (!opt) return; | ||
const { | ||
value, | ||
percent | ||
} = opt; | ||
const prefix = `TOP ${value}`; | ||
if (!percent) return prefix; | ||
return `${prefix} ${percent.toUpperCase()}`; | ||
} | ||
function identifierToSql(ident, isDual) { | ||
@@ -168,0 +180,0 @@ const { |
{ | ||
"name": "node-sql-parser", | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"description": "simple node sql parser", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
2531929
90321