Beispiel #1
0
 /**
  *
  * @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;
 }
Beispiel #2
0
 /**
  * @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();
 }
Beispiel #3
0
 /**
  *
  */
 public function dump()
 {
     $this->_request->dump();
     $this->response()->dump();
 }