@@ -381,7 +381,7 @@ export default function Postgres(url, options) {
381
381
function selectHelper ( first , columns , xargs , types ) {
382
382
return Object . entries ( first ) . reduce ( ( acc , [ k , v ] ) =>
383
383
acc + ( ! columns . length || columns . indexOf ( k ) > - 1
384
- ? ( acc ? ', ' : '' ) + parseValue ( v , xargs , types ) + ' as ' + escape ( k )
384
+ ? ( acc ? ',' : '' ) + parseValue ( v , xargs , types ) + ' as ' + escape ( k )
385
385
: ''
386
386
)
387
387
, '' )
@@ -393,29 +393,29 @@ export default function Postgres(url, options) {
393
393
first . map ( row =>
394
394
'(' + Object . entries ( row ) . reduce ( ( acc , [ k , v ] ) =>
395
395
acc + ( ! columns . length || columns . indexOf ( k ) > - 1
396
- ? ( acc ? ', ' : '' ) + parseValue ( v , xargs , types )
396
+ ? ( acc ? ',' : '' ) + parseValue ( v , xargs , types )
397
397
: ''
398
398
)
399
399
, '' ) + ')'
400
- ) . join ( ', ' )
400
+ ) . join ( ',' )
401
401
}
402
402
403
403
function equalsHelper ( first , columns , xargs , types ) {
404
404
return Object . entries ( first ) . reduce ( ( acc , [ k , v ] ) =>
405
405
acc + ( ! columns . length || columns . indexOf ( k ) > - 1
406
- ? ( acc ? ', ' : '' ) + escape ( k ) + ' = ' + parseValue ( v , xargs , types )
406
+ ? ( acc ? ',' : '' ) + escape ( k ) + ' = ' + parseValue ( v , xargs , types )
407
407
: ''
408
408
)
409
409
, '' )
410
410
}
411
411
412
412
function escapeHelper ( xs ) {
413
- return xs . reduce ( ( acc , x ) => acc + ( acc ? ', ' : '' ) + escape ( x ) , '' )
413
+ return xs . reduce ( ( acc , x ) => acc + ( acc ? ',' : '' ) + escape ( x ) , '' )
414
414
}
415
415
416
416
function parseValue ( x , xargs , types ) {
417
417
return Array . isArray ( x )
418
- ? x . reduce ( ( acc , x ) => addValue ( x , xargs , types ) , '' )
418
+ ? x . reduce ( ( acc , x ) => acc + ( acc ? ',' : '' ) + addValue ( x , xargs , types ) , '' )
419
419
: addValue ( x , xargs , types )
420
420
}
421
421
0 commit comments