@@ -187,14 +187,14 @@ Postgres.prototype.quote = function(word, quoteCharacter) {
187187 }
188188 // handle square brackets specially
189189 if ( q == '[' ) {
190- return '[' + word + ']'
190+ return '[' + word + ']' ;
191191 } else {
192192 return q + word . replace ( new RegExp ( q , 'g' ) , q + q ) + q ;
193193 }
194194} ;
195195
196196Postgres . prototype . visitSelect = function ( select ) {
197- var result = [ 'SELECT' ]
197+ var result = [ 'SELECT' ] ;
198198
199199 if ( select . isDistinct ) result . push ( 'DISTINCT' ) ;
200200
@@ -281,7 +281,7 @@ Postgres.prototype.visitCreate = function(create) {
281281 var col_nodes = table . columns . map ( function ( col ) { return col . toNode ( ) ; } ) ;
282282
283283 var result = [ 'CREATE TABLE' ] ;
284- if ( create . options . isTemporary ) result = [ 'CREATE TEMPORARY TABLE' ]
284+ if ( create . options . isTemporary ) result = [ 'CREATE TEMPORARY TABLE' ] ;
285285 result = result . concat ( create . nodes . map ( this . visit . bind ( this ) ) ) ;
286286 result . push ( this . visit ( table . toNode ( ) ) ) ;
287287 var primary_col_nodes = col_nodes . filter ( function ( n ) {
@@ -547,7 +547,7 @@ Postgres.prototype.visitCase = function(caseExp) {
547547
548548 text += ' END)' ;
549549 return [ text ] ;
550- }
550+ } ;
551551
552552Postgres . prototype . visitAt = function ( at ) {
553553 var text = '(' + this . visit ( at . value ) + ')[' + this . visit ( at . index ) + ']' ;
@@ -637,7 +637,7 @@ Postgres.prototype.visitQuery = function(queryNode) {
637637 throw new Error ( 'Create View requires a Select.' ) ;
638638 }
639639 }
640- return this . visitQueryHelper ( actions , targets , filters )
640+ return this . visitQueryHelper ( actions , targets , filters ) ;
641641} ;
642642
643643/**
@@ -649,7 +649,7 @@ Postgres.prototype.visitQuery = function(queryNode) {
649649 * @returns {String[] }
650650 */
651651Postgres . prototype . visitQueryHelper = function ( actions , targets , filters ) {
652- this . handleDistinct ( actions , filters )
652+ this . handleDistinct ( actions , filters ) ;
653653 // lazy-man sorting
654654 var sortedNodes = actions . concat ( targets ) . concat ( filters ) ;
655655 for ( var i = 0 ; i < sortedNodes . length ; i ++ ) {
@@ -658,7 +658,7 @@ Postgres.prototype.visitQueryHelper=function(actions,targets,filters){
658658 }
659659 // implicit 'from'
660660 return this . output ;
661- }
661+ } ;
662662
663663Postgres . prototype . visitSubquery = function ( queryNode ) {
664664 // create another query builder of the current class to build the subquery
@@ -786,7 +786,7 @@ Postgres.prototype.visitColumn = function(columnNode) {
786786 txt . push ( ' NOT NULL' ) ;
787787 }
788788 if ( ! columnNode . primaryKey && columnNode . unique ) {
789- txt . push ( ' UNIQUE' )
789+ txt . push ( ' UNIQUE' ) ;
790790 }
791791 }
792792
@@ -817,7 +817,7 @@ Postgres.prototype.visitColumn = function(columnNode) {
817817 var onDelete = columnNode . references . onDelete ;
818818 if ( onDelete ) onDelete = onDelete . toUpperCase ( ) ;
819819 if ( onDelete === 'CASCADE' || onDelete === 'RESTRICT' ) {
820- txt . push ( ' ON DELETE ' + onDelete )
820+ txt . push ( ' ON DELETE ' + onDelete ) ;
821821 }
822822 }
823823 }
@@ -1006,8 +1006,8 @@ Postgres.prototype.findNode=function(list,type) {
10061006 var n = list [ i ] ;
10071007 if ( n . type == type ) return { index :i , node :n } ;
10081008 }
1009- return undefined
1010- }
1009+ return undefined ;
1010+ } ;
10111011
10121012/**
10131013 * pulls the DISTINCT node out of the filters and flags the SELECT node that it should be distinct.
@@ -1017,11 +1017,11 @@ Postgres.prototype.handleDistinct = function(actions,filters) {
10171017 var distinctNode = this . findNode ( filters , "DISTINCT" ) ;
10181018 //if (!distinctNode) distinctNode = _findNode(targets,"DISTINCT");
10191019 //if (!distinctNode) distinctNode = _findNode(actions,"DISTINCT");
1020- if ( ! distinctNode ) return
1020+ if ( ! distinctNode ) return ;
10211021 var selectInfo = this . findNode ( actions , "SELECT" ) ;
1022- if ( ! selectInfo ) return // there should be one by now, I think
1022+ if ( ! selectInfo ) return ; // there should be one by now, I think
10231023 // mark the SELECT node that it's distinct
10241024 selectInfo . node . isDistinct = true ;
1025- }
1025+ } ;
10261026
10271027module . exports = Postgres ;
0 commit comments