diff --git a/src/Client.php b/src/Client.php index 2a5b37a..87d71f1 100644 --- a/src/Client.php +++ b/src/Client.php @@ -422,12 +422,12 @@ public function readWithParams(Stream $streamRead, string $sql, array $params, a * @param array $querySettings Per-query settings override * @return \Generator yields associative arrays, one per row */ - public function selectGenerator(string $sql, array $bindings = [], array $querySettings = []): \Generator + public function selectGenerator(string $sql, array $bindings = [], array $querySettings = [], ?WhereInFile $whereInFile = null): \Generator { $stream = fopen('php://temp', 'r+'); $streamRead = new Transport\StreamRead($stream); - $this->transport()->streamRead($streamRead, $sql . ' FORMAT JSONEachRow', $bindings, $querySettings); + $this->transport()->streamRead($streamRead, $sql . ' FORMAT JSONEachRow', $bindings, $querySettings, $whereInFile); rewind($stream); diff --git a/src/Transport/Http.php b/src/Transport/Http.php index 9d4e434..5550bef 100644 --- a/src/Transport/Http.php +++ b/src/Transport/Http.php @@ -973,10 +973,10 @@ private function streaming(Stream $streamRW, CurlerRequest $request): Statement * @return Statement * @throws \ClickHouseDB\Exception\TransportException */ - public function streamRead(Stream $streamRead, $sql, $bindings = [], array $querySettings = []): Statement + public function streamRead(Stream $streamRead, $sql, $bindings = [], array $querySettings = [], ?WhereInFile $whereInFile = null): Statement { $sql = $this->prepareQuery($sql, $bindings); - $request = $this->getRequestRead($sql, null, null, $querySettings); + $request = $this->getRequestRead($sql, $whereInFile, null, $querySettings); return $this->streaming($streamRead, $request); }