node_modules/mariadb/lib/cmd/batch-rewrite.js
/**
   * Send COM_QUERY
   *
   * @param out   output writer
   * @param opts  connection options
   * @param info  connection information
   */
Send COM_QUERY
@param out   output writer
@param opts  connection options
@param info  connection information
Send COM_QUERY @param out output writer @param opts connection options @param info connection information
start(out, opts, info) {
    this.sending = true;
    this.info = info;
    if (this.opts.timeout) {
      const err = Errors.createError(
        'Cannot use timeout for Batch statement',
        false,
        info,
        'HY000',
        Errors.ER_TIMEOUT_NOT_SUPPORTED
      );
      this.emit('send_end');
      this.throwError(err, info);
      return;
    }
    if (this.initialValues.length === 0) this.initialValues = [[]];
    if (this.opts.namedPlaceholders) {
      this.parseResults = Parse.splitRewritableNamedParameterQuery(this.sql, this.initialValues);
      this.values = this.parseResults.values;
    } else {
      this.parseResults = Parse.splitRewritableQuery(this.sql);
      this.values = this.initialValues;
      if (!this.validateParameters(info)) {
        this.sending = false;
        return;
      }
    }
    out.startPacket(this);
    this.packet = new RewritePacket(
      this.opts.maxAllowedPacket,
      out,
      this.parseResults.partList[0],
      this.parseResults.partList[this.parseResults.partList.length - 1]
    );
    this.onPacketReceive = this.readResponsePacket;
    this.valueIdx = 0;
    this.sendQueries();
  }
start ( out , opts , info ) { this . sending = true ; this . info = info ; if ( this . opts . timeout ) { const err = Errors . createError ( 'Cannot use timeout for Batch statement' , false , info , 'HY000' , Errors . ER_TIMEOUT_NOT_SUPPORTED ) ; this . emit ( 'send_end' ) ; this . throwError ( err , info ) ; return ; } if ( this . initialValues . length === 0 ) this . initialValues = [ [ ] ] ; if ( this . opts . namedPlaceholders ) { this . parseResults = Parse . splitRewritableNamedParameterQuery ( this . sql , this . initialValues ) ; this . values = this . parseResults . values ; } else { this . parseResults = Parse . splitRewritableQuery ( this . sql ) ; this . values = this . initialValues ; if ( ! this . validateParameters ( info ) ) { this . sending = false ; return ; } } out . startPacket ( this ) ; this . packet = new RewritePacket ( this . opts . maxAllowedPacket , out , this . parseResults . partList [ 0 ] , this . parseResults . partList [ this . parseResults . partList . length - 1 ] ) ; this . onPacketReceive = this . readResponsePacket ; this . valueIdx = 0 ; this . sendQueries ( ) ; }
Send COM_QUERY
 @param out   output writer
 @param opts  connection options
 @param info  connection information
Send COM_QUERY @param out output writer @param opts connection options @param info connection information