Comparing version 0.36.0 to 0.37.0
@@ -123,2 +123,3 @@ 'use strict'; | ||
case 'JOIN' : return this.visitJoin(node); | ||
case 'LITERAL' : return this.visitLiteral(node); | ||
case 'TEXT' : return node.text; | ||
@@ -588,3 +589,3 @@ case 'PARAMETER' : return this.visitParameter(node); | ||
var closeParen = 0; | ||
if(inSelectClause && !table.alias) { | ||
if(inSelectClause && (!table.alias || !!columnNode.alias)) { | ||
if (columnNode.asArray) { | ||
@@ -719,2 +720,10 @@ closeParen++; | ||
Postgres.prototype.visitLiteral = function(node) { | ||
var txt = [node.literal]; | ||
if(node.alias) { | ||
txt.push(' AS ' + this.quote(node.alias)); | ||
} | ||
return [txt.join('')]; | ||
}; | ||
Postgres.prototype.visitReturning = function(returning) { | ||
@@ -721,0 +730,0 @@ this.visitingReturning = true; |
@@ -10,2 +10,3 @@ 'use strict'; | ||
var JoinNode = require(__dirname + '/node/join'); | ||
var LiteralNode = require(__dirname + '/node/literal'); | ||
var Joiner = require(__dirname + '/joiner'); | ||
@@ -136,2 +137,6 @@ | ||
Table.prototype.literal = function(literal) { | ||
return new LiteralNode(literal); | ||
} | ||
Table.prototype.count = function(alias) { | ||
@@ -138,0 +143,0 @@ var name = this.alias || this._name, |
@@ -5,3 +5,3 @@ { | ||
"description": "sql builder", | ||
"version": "0.36.0", | ||
"version": "0.37.0", | ||
"homepage": "https://github.com/brianc/node-sql", | ||
@@ -8,0 +8,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
275823
117
7370
100