@@ -444,8 +444,9 @@ function Postgres(a, b) {
444
444
acc + ( ! columns . length || columns . indexOf ( k ) > - 1
445
445
? ( acc ? ',' : '' ) + parseValue ( v , xargs , types ) + ' as ' + escape ( k )
446
446
: ''
447
- )
448
- , '' )
447
+ ) ,
448
+ ''
449
+ )
449
450
}
450
451
451
452
function insertHelper ( first , columns , xargs , types ) {
@@ -455,14 +456,16 @@ function Postgres(a, b) {
455
456
first . reduce ( ( acc , row ) =>
456
457
acc + ( acc ? ',' : '' ) + '(' +
457
458
columns . reduce ( ( acc , k ) => acc + ( acc ? ',' : '' ) + parseValue ( row [ k ] , xargs , types ) , '' ) +
458
- ')'
459
- , '' )
459
+ ')' ,
460
+ ''
461
+ )
460
462
}
461
463
462
464
function equalsHelper ( first , columns , xargs , types ) {
463
465
return ( columns . length ? columns : Object . keys ( first ) ) . reduce ( ( acc , k ) =>
464
- acc + ( acc ? ',' : '' ) + escape ( k ) + ' = ' + parseValue ( first [ k ] , xargs , types )
465
- , '' )
466
+ acc + ( acc ? ',' : '' ) + escape ( k ) + ' = ' + parseValue ( first [ k ] , xargs , types ) ,
467
+ ''
468
+ )
466
469
}
467
470
468
471
function escapeHelper ( xs ) {
@@ -476,8 +479,8 @@ function Postgres(a, b) {
476
479
return Array . isArray ( x )
477
480
? x . reduce ( ( acc , x ) => acc + ( acc ? ',' : '' ) + addValue ( x , xargs , types ) , '' )
478
481
: x && x . P === notPromise . P
479
- ? parseArg ( '' , x , xargs , types )
480
- : addValue ( x , xargs , types )
482
+ ? parseArg ( '' , x , xargs , types )
483
+ : addValue ( x , xargs , types )
481
484
}
482
485
483
486
function addValue ( x , xargs , types ) {
@@ -523,8 +526,8 @@ function parseOptions(a, b) {
523
526
max : o . max || url . query . max || 10 ,
524
527
types : o . types || { } ,
525
528
ssl : o . ssl || url . ssl || false ,
526
- idle_timeout : o . idle_timeout || url . query . idle_timeout || env . PGIDLE_TIMEOUT || warn ( o . timeout , 'The timeout option is deprecated, use idle_timeout instead' ) ,
527
- connect_timeout : o . connect_timeout || url . query . connect_timeout || env . PGCONNECT_TIMEOUT || 30 ,
529
+ idle_timeout : o . idle_timeout || url . query . idle_timeout || env . PGIDLE_TIMEOUT || warn ( o . timeout ) ,
530
+ connect_timeout : o . connect_timeout || url . query . connect_timeout || env . PGCONNECT_TIMEOUT || 30 ,
528
531
onnotice : o . onnotice ,
529
532
onparameter : o . onparameter ,
530
533
transform : Object . assign ( { } , o . transform ) ,
@@ -535,8 +538,8 @@ function parseOptions(a, b) {
535
538
)
536
539
}
537
540
538
- function warn ( x , message ) {
539
- typeof x !== 'undefined' && console . log ( message )
541
+ function warn ( x ) {
542
+ typeof x !== 'undefined' && console . log ( 'The timeout option is deprecated, use idle_timeout instead' ) // eslint-disable-line
540
543
return x
541
544
}
542
545
0 commit comments