Skip to content

Latest commit

 

History

History
31 lines (27 loc) · 667 Bytes

README.md

File metadata and controls

31 lines (27 loc) · 667 Bytes

PhpClickHouseClient

PHP Client for ClickHouse HTTP interface

Use examples

$data = (new ChcClient())->getJsonData($query);
$client = new ChcClient();

try {
    if ($client->ping()) {
        $client->readOnly(true);
        $result = $client->getRaw($query, ChcFormat::JSONEachRow);
    } else {
        throw new Exception('ClickHouse is down.');
    }
}
catch (ChcException $e) {
    $error = $e->getMessage();
}
$latency = $client->getLastQueryLatency();

Install through Composer

"require": {
    "seva-code/php-click-house-client": "^1.2.0-dev"
}