@@ -162,6 +162,7 @@ Postgres.prototype.visit = function(node) {
162162 case 'DEFAULT' : return this . visitDefault ( node ) ;
163163 case 'IF EXISTS' : return this . visitIfExists ( ) ;
164164 case 'IF NOT EXISTS' : return this . visitIfNotExists ( ) ;
165+ case 'OR IGNORE' : return this . visitOrIgnore ( ) ;
165166 case 'CASCADE' : return this . visitCascade ( ) ;
166167 case 'RESTRICT' : return this . visitRestrict ( ) ;
167168 case 'RENAME' : return this . visitRename ( node ) ;
@@ -237,11 +238,10 @@ Postgres.prototype.visitInsert = function(insert) {
237238 // don't use table.column for inserts
238239 this . _visitedInsert = true ;
239240
240- var result = [
241- 'INSERT INTO' ,
242- this . visit ( this . _queryNode . table . toNode ( ) ) ,
243- '(' + insert . columns . map ( this . visit . bind ( this ) ) . join ( ', ' ) + ')'
244- ] ;
241+ var result = [ 'INSERT' ] ;
242+ result = result . concat ( insert . nodes . map ( this . visit . bind ( this ) ) ) ;
243+ result . push ( 'INTO ' + this . visit ( this . _queryNode . table . toNode ( ) ) ) ;
244+ result . push ( '(' + insert . columns . map ( this . visit . bind ( this ) ) . join ( ', ' ) + ')' ) ;
245245
246246 var paramNodes = insert . getParameters ( ) ;
247247
@@ -995,6 +995,10 @@ Postgres.prototype.visitIfNotExists = function() {
995995 return [ 'IF NOT EXISTS' ] ;
996996} ;
997997
998+ Postgres . prototype . visitOrIgnore = function ( ) {
999+ throw new Error ( 'PostgreSQL does not allow orIgnore clause.' ) ;
1000+ } ;
1001+
9981002Postgres . prototype . visitCascade = function ( ) {
9991003 return [ 'CASCADE' ] ;
10001004} ;
0 commit comments