Comparing version 0.63.1 to 0.64.0
@@ -692,3 +692,3 @@ 'use strict'; | ||
txt += this.quote(table.getName()); | ||
if(table.alias) { | ||
if(typeof table.alias === 'string') { | ||
txt += this._aliasText + this.quote(table.alias); | ||
@@ -733,3 +733,3 @@ } | ||
if(!inInsertUpdateClause && !this.visitingReturning && !this._visitingCreate && !this._visitingAlter && !columnNode.subfieldContainer) { | ||
if(table.alias) { | ||
if(typeof table.alias === 'string') { | ||
txt.push(this.quote(table.alias)); | ||
@@ -736,0 +736,0 @@ } else { |
@@ -5,3 +5,3 @@ { | ||
"description": "sql builder", | ||
"version": "0.63.1", | ||
"version": "0.64.0", | ||
"homepage": "https://github.com/brianc/node-sql", | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
@@ -9,3 +9,3 @@ 'use strict'; | ||
name: 'user', | ||
columns: ['id', 'created'] | ||
columns: ['id', 'created', 'alias'] | ||
}); | ||
@@ -22,2 +22,6 @@ | ||
it('works with a column name of "alias"', function() { | ||
assert.equal(table.alias.toQuery().text, '"user"."alias"'); | ||
}); | ||
it('respects AS rename', function() { | ||
@@ -24,0 +28,0 @@ assert.equal(table.id.as('userId').toQuery().text, '"user"."id" AS "userId"'); |
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
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
457670
11734