code: function arrayString (val) {
    var result = '{'
    for (var i = 0; i < val.length; i++) {
      if (i > 0) {
        result = result + ','
      }
      if (val[i] === null || typeof val[i] === 'undefined') {
        result = result + 'NULL'
      } else if (Array.isArray(val[i])) {
        result = result + arrayString(val[i])
      } else if (val[i] instanceof Buffer) {
        result += '\\\\x' + val[i].toString('hex')
      } else {
        result += escapeElement(prepareValue(val[i]))
      }
    }
    result = result + '}'
    return result
  }
docs: convert a JS array to a postgres array literal uses comma separator so won't work for types like box that use a different array separator.