result = $result; parent::__construct(new Producer(static function (callable $emit) use ($result) { while ($row = $result->fetchRow(pq\Result::FETCH_ASSOC)) { yield $emit($row); } })); } public function numRows(): int { return $this->result->numRows; } public function numFields(): int { return $this->result->numCols; } }