node-sql-parser
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -29,2 +29,3 @@ (function (global, factory) { | ||
assign: _assign.assignToSQL, | ||
extract: _util.extractFunToSQL, | ||
binary_expr: _binary.binaryToSQL, | ||
@@ -31,0 +32,0 @@ case: _case.caseToSQL, |
@@ -40,2 +40,3 @@ (function (global, factory) { | ||
_exports.triggerEventToSQL = triggerEventToSQL; | ||
_exports.extractFunToSQL = extractFunToSQL; | ||
_exports.DEFAULT_OPT = void 0; | ||
@@ -383,2 +384,16 @@ const escapeMap = { | ||
function extractFunToSQL(stmt) { | ||
const { | ||
args, | ||
type | ||
} = stmt; | ||
const { | ||
field, | ||
cast_type: castType, | ||
source | ||
} = args; | ||
const result = [`${toUpper(type)}(${toUpper(field)}`, 'FROM', toUpper(castType), literalToSQL(source)]; | ||
return `${result.filter(hasVal).join(' ')})`; | ||
} | ||
function autoIncreatementToSQL(autoIncreatement) { | ||
@@ -385,0 +400,0 @@ if (!autoIncreatement || typeof autoIncreatement === 'string') return toUpper(autoIncreatement); |
{ | ||
"name": "node-sql-parser", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"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
4863674
134514