docs: function quoteLiteral(value) {
  
      var literal = null;
      var explicitCast = null;
  
      if (value === undefined || value === null) {
          return 'NULL';
      } else if (value === false) {
          return "'f'";
      } else if (value === true) {
          return "'t'";
      } else if (value instanceof Date) {
          return "'" + formatDate(value.toISOString()) + "'";
      } else if (value instanceof Buffer) {
          return "E'\\\\x" + value.toString('hex') + "'";
      } else if (Array.isArray(value) === true) {
          var temp = [];
          for (var i = 0; i < value.length; i++) {
              if (Array.isArray(value[i]) === true) {
                  temp.push(arrayToList(i !== 0, value[i], quoteLiteral))
              } else {
                  temp.push(quoteLiteral(value[i]));
              }
          }
          return temp.toString();
      } else if (value === Object(value)) {
          explicitCast = 'jsonb';
          literal = JSON.stringify(value);
      } else {
          literal = value.toString().slice(0); // create copy
      }
  
      var hasBackslash = false;
      var quoted = '\'';
  
      for (var i = 0; i < literal.length; i++) {
          var c = literal[i];
          if (c === '\'') {
              quoted += c + c;
          } else if (c === '\\') {
              quoted += c + c;
              hasBackslash = true;
          } else {
              quoted += c;
          }
      }
  
      quoted += '\'';
  
      if (hasBackslash === true) {
          quoted = 'E' + quoted;
      }
  
      if (explicitCast) {
          quoted += '::' + explicitCast;
      }
  
      return quoted;
  }