seva-code/php-click-house-client

PHP Client for ClickHouse HTTP interface

dev-master / 1.2.x-dev 2020-06-18 08:34 UTC

This package is auto-updated.

Last update: 2020-07-18 09:23:52 UTC


README

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"
}