diff --git a/src/BatchQueryResult.php b/src/BatchQueryResult.php deleted file mode 100644 index 91dce5d7..00000000 --- a/src/BatchQueryResult.php +++ /dev/null @@ -1,47 +0,0 @@ -dataReader?->next(); - /** @psalm-var array|bool $row */ - $row = $this->dataReader?->current(); - } while ($row && ($rows[] = $row) && ++$count < $this->batchSize); - } catch (PDOException $e) { - if (!in_array($this->mssqlNoMoreRowsErrorCode, (array) $e->errorInfo, true)) { - throw $e; - } - } - - return $rows; - } -} diff --git a/src/Connection.php b/src/Connection.php index 79cca8b6..a8bd3432 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -6,8 +6,6 @@ use Yiisoft\Db\Driver\Pdo\AbstractPdoConnection; use Yiisoft\Db\Driver\Pdo\PdoCommandInterface; -use Yiisoft\Db\Query\BatchQueryResultInterface; -use Yiisoft\Db\Query\QueryInterface; use Yiisoft\Db\QueryBuilder\QueryBuilderInterface; use Yiisoft\Db\Schema\QuoterInterface; use Yiisoft\Db\Schema\SchemaInterface; @@ -20,11 +18,6 @@ */ final class Connection extends AbstractPdoConnection { - public function createBatchQueryResult(QueryInterface $query, bool $each = false): BatchQueryResultInterface - { - return new BatchQueryResult($query, $each); - } - public function createCommand(string $sql = null, array $params = []): PdoCommandInterface { $command = new Command($this); diff --git a/tests/BatchQueryResultTest.php b/tests/BatchQueryResultTest.php deleted file mode 100644 index 67806115..00000000 --- a/tests/BatchQueryResultTest.php +++ /dev/null @@ -1,35 +0,0 @@ -getConnection(true); - - $query = new Query($db); - $query->from('customer')->orderBy('id')->limit(3)->indexBy('id'); - - $batchQueryResult = new BatchQueryResult($query); - - $customers = $this->getAllRowsFromBatch($batchQueryResult); - - $this->assertCount(3, $customers); - $this->assertEquals('user1', $customers[0]['name']); - $this->assertEquals('user2', $customers[1]['name']); - $this->assertEquals('user3', $customers[2]['name']); - } -}