/** * * @return \ClickHouseDB\Statement */ public function insert() { $read_stream = $this->read; $this->insert->header('Transfer-Encoding', 'chunked'); $this->insert->setReadFunction(function ($ch, $fd, $length) use($read_stream) { $d = fread($read_stream, $length); return $d ? $d : ""; }); $this->insert->setCallbackFunction(function (\Curler\Request $request) use($read_stream) { fclose($read_stream); }); $this->roll->addQueLoop($this->insert); $this->roll->execLoopWait(); $state = new \ClickHouseDB\Statement($this->insert); $state->error(); return $state; }
/** * @param Request $req * @param bool $auto_close * @return mixed */ public function execOne(Request $req, $auto_close = false) { $h = $req->handle(); curl_exec($h); $req->setResponse($this->makeResponse($h)); if ($auto_close) { $req->close(); } return $req->response()->http_code(); }
/** * */ public function dump() { $this->_request->dump(); $this->response()->dump(); }