code: function (val, seen) {
    if (val instanceof Buffer) {
      return val
    }
    if (ArrayBuffer.isView(val)) {
      var buf = Buffer.from(val.buffer, val.byteOffset, val.byteLength)
      if (buf.length === val.byteLength) {
        return buf
      }
      return buf.slice(val.byteOffset, val.byteOffset + val.byteLength) // Node.js v4 does not support those Buffer.from params
    }
    if (val instanceof Date) {
      if (defaults.parseInputDatesAsUTC) {
        return dateToStringUTC(val)
      } else {
        return dateToString(val)
      }
    }
    if (Array.isArray(val)) {
      return arrayString(val)
    }
    if (val === null || typeof val === 'undefined') {
      return null
    }
    if (typeof val === 'object') {
      return prepareObject(val, seen)
    }
    return val.toString()
  }
docs: converts values from javascript types to their 'raw' counterparts for use as a postgres parameter note: you can override this function to provide your own conversion mechanism for complex types, etc...