@@ -187,14 +187,14 @@ Postgres.prototype.quote = function(word, quoteCharacter) {
187
187
}
188
188
// handle square brackets specially
189
189
if ( q == '[' ) {
190
- return '[' + word + ']'
190
+ return '[' + word + ']' ;
191
191
} else {
192
192
return q + word . replace ( new RegExp ( q , 'g' ) , q + q ) + q ;
193
193
}
194
194
} ;
195
195
196
196
Postgres . prototype . visitSelect = function ( select ) {
197
- var result = [ 'SELECT' ]
197
+ var result = [ 'SELECT' ] ;
198
198
199
199
if ( select . isDistinct ) result . push ( 'DISTINCT' ) ;
200
200
@@ -281,7 +281,7 @@ Postgres.prototype.visitCreate = function(create) {
281
281
var col_nodes = table . columns . map ( function ( col ) { return col . toNode ( ) ; } ) ;
282
282
283
283
var result = [ 'CREATE TABLE' ] ;
284
- if ( create . options . isTemporary ) result = [ 'CREATE TEMPORARY TABLE' ]
284
+ if ( create . options . isTemporary ) result = [ 'CREATE TEMPORARY TABLE' ] ;
285
285
result = result . concat ( create . nodes . map ( this . visit . bind ( this ) ) ) ;
286
286
result . push ( this . visit ( table . toNode ( ) ) ) ;
287
287
var primary_col_nodes = col_nodes . filter ( function ( n ) {
@@ -547,7 +547,7 @@ Postgres.prototype.visitCase = function(caseExp) {
547
547
548
548
text += ' END)' ;
549
549
return [ text ] ;
550
- }
550
+ } ;
551
551
552
552
Postgres . prototype . visitAt = function ( at ) {
553
553
var text = '(' + this . visit ( at . value ) + ')[' + this . visit ( at . index ) + ']' ;
@@ -637,7 +637,7 @@ Postgres.prototype.visitQuery = function(queryNode) {
637
637
throw new Error ( 'Create View requires a Select.' ) ;
638
638
}
639
639
}
640
- return this . visitQueryHelper ( actions , targets , filters )
640
+ return this . visitQueryHelper ( actions , targets , filters ) ;
641
641
} ;
642
642
643
643
/**
@@ -649,7 +649,7 @@ Postgres.prototype.visitQuery = function(queryNode) {
649
649
* @returns {String[] }
650
650
*/
651
651
Postgres . prototype . visitQueryHelper = function ( actions , targets , filters ) {
652
- this . handleDistinct ( actions , filters )
652
+ this . handleDistinct ( actions , filters ) ;
653
653
// lazy-man sorting
654
654
var sortedNodes = actions . concat ( targets ) . concat ( filters ) ;
655
655
for ( var i = 0 ; i < sortedNodes . length ; i ++ ) {
@@ -658,7 +658,7 @@ Postgres.prototype.visitQueryHelper=function(actions,targets,filters){
658
658
}
659
659
// implicit 'from'
660
660
return this . output ;
661
- }
661
+ } ;
662
662
663
663
Postgres . prototype . visitSubquery = function ( queryNode ) {
664
664
// create another query builder of the current class to build the subquery
@@ -786,7 +786,7 @@ Postgres.prototype.visitColumn = function(columnNode) {
786
786
txt . push ( ' NOT NULL' ) ;
787
787
}
788
788
if ( ! columnNode . primaryKey && columnNode . unique ) {
789
- txt . push ( ' UNIQUE' )
789
+ txt . push ( ' UNIQUE' ) ;
790
790
}
791
791
}
792
792
@@ -817,7 +817,7 @@ Postgres.prototype.visitColumn = function(columnNode) {
817
817
var onDelete = columnNode . references . onDelete ;
818
818
if ( onDelete ) onDelete = onDelete . toUpperCase ( ) ;
819
819
if ( onDelete === 'CASCADE' || onDelete === 'RESTRICT' ) {
820
- txt . push ( ' ON DELETE ' + onDelete )
820
+ txt . push ( ' ON DELETE ' + onDelete ) ;
821
821
}
822
822
}
823
823
}
@@ -1006,8 +1006,8 @@ Postgres.prototype.findNode=function(list,type) {
1006
1006
var n = list [ i ] ;
1007
1007
if ( n . type == type ) return { index :i , node :n } ;
1008
1008
}
1009
- return undefined
1010
- }
1009
+ return undefined ;
1010
+ } ;
1011
1011
1012
1012
/**
1013
1013
* 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) {
1017
1017
var distinctNode = this . findNode ( filters , "DISTINCT" ) ;
1018
1018
//if (!distinctNode) distinctNode = _findNode(targets,"DISTINCT");
1019
1019
//if (!distinctNode) distinctNode = _findNode(actions,"DISTINCT");
1020
- if ( ! distinctNode ) return
1020
+ if ( ! distinctNode ) return ;
1021
1021
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
1023
1023
// mark the SELECT node that it's distinct
1024
1024
selectInfo . node . isDistinct = true ;
1025
- }
1025
+ } ;
1026
1026
1027
1027
module . exports = Postgres ;
0 commit comments