Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,13 @@ local ClickHouse database and send some queries:

require __DIR__ . '/vendor/autoload.php';

$client = new Clue\React\ClickHouse\ClickHouseClient('http://localhost:8123/');
$db = new Clue\React\ClickHouse\ClickHouseClient('http://localhost:8123/');

$client->query('SELECT id, name FROM users')->then(function (Clue\React\ClickHouse\Result $result) {
var_dump($result);
$db->query('SELECT id, name FROM users')->then(function (Clue\React\ClickHouse\Result $result) {
echo count($result->data) . ' row(s) in set' . PHP_EOL;
foreach ($result->data as $user) {
echo $user['id'] . ': ' . $user['name'] . PHP_EOL;
}
}, function (Exception $e) {
echo 'Error: ' . $e->getMessage() . PHP_EOL;
});
Expand Down Expand Up @@ -463,7 +466,6 @@ You can run a temporary ClickHouse database server in a Docker container like th
$ docker run -it --rm --net=host yandex/clickhouse-server
```


## License

This project is released under the permissive [MIT license](LICENSE).
Expand Down