Allow passing a JS array instead of an array literal where SQL expects an array

Constructing postgres array literals is tedious and error prone. This does the work for you (except for type box, which uses a different separator in array literals).