lib/Mysql.php
protected function insertBatch(string $table, array $colVals, int $identityIncrement = 1): BulkInsertResult
    {
        $sqlParams = (new Insert($this->options))->buildQuery($table, $colVals);
        $result = $this->query($sqlParams->getSql(), $sqlParams->getParams());
        $firstId = $result->getInsertId(); // ID of first inserted row, or zero if no insert ID

        if ($firstId) {
            $lastId = $firstId + $identityIncrement * (count($colVals) - 1);
            $ids = range($firstId, $lastId, $identityIncrement);
        } else {
            $ids = [];
        }

        return new BulkInsertResult($ids, $result->getAffected());
    }
protected function insertBatch(string $table, array $colVals, int $identityIncrement = 1): BulkInsertResult
    {
        $sqlParams = (new Insert($this->options))->buildQuery($table, $colVals);
        $result = $this->query($sqlParams->getSql(), $sqlParams->getParams());
        $firstId = $result->getInsertId(); // ID of first inserted row, or zero if no insert ID

        if ($firstId) {
            $lastId = $firstId + $identityIncrement * (count($colVals) - 1);
            $ids = range($firstId, $lastId, $identityIncrement);
        } else {
            $ids = [];
        }

        return new BulkInsertResult($ids, $result->getAffected());
    }
protected function insertBatch ( string $ table , array $ colVals , int $ identityIncrement = 1 ) : BulkInsertResult { $ sqlParams = ( new Insert ( $ this -> options ) ) -> buildQuery ( $ table , $ colVals ) ; $ result = $ this -> query ( $ sqlParams -> getSql ( ) , $ sqlParams -> getParams ( ) ) ; $ firstId = $ result -> getInsertId ( ) ; // ID of first inserted row, or zero if no insert ID if ( $ firstId ) { $ lastId = $ firstId + $ identityIncrement * ( count ( $ colVals ) - 1 ) ; $ ids = range ( $ firstId , $ lastId , $ identityIncrement ) ; } else { $ ids = [ ] ; } return new BulkInsertResult ( $ ids , $ result -> getAffected ( ) ) ; }
Performs a single bulk insert query
Performs a single bulk insert query