File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,13 @@ local ClickHouse database and send some queries:
69
69
70
70
require __DIR__ . '/vendor/autoload.php';
71
71
72
- $client = new Clue\React\ClickHouse\ClickHouseClient('http://localhost:8123/');
72
+ $db = new Clue\React\ClickHouse\ClickHouseClient('http://localhost:8123/');
73
73
74
- $client->query('SELECT id, name FROM users')->then(function (Clue\React\ClickHouse\Result $result) {
75
- var_dump($result);
74
+ $db->query('SELECT id, name FROM users')->then(function (Clue\React\ClickHouse\Result $result) {
75
+ echo count($result->data) . ' row(s) in set' . PHP_EOL;
76
+ foreach ($result->data as $user) {
77
+ echo $user['id'] . ': ' . $user['name'] . PHP_EOL;
78
+ }
76
79
}, function (Exception $e) {
77
80
echo 'Error: ' . $e->getMessage() . PHP_EOL;
78
81
});
@@ -463,7 +466,6 @@ You can run a temporary ClickHouse database server in a Docker container like th
463
466
$ docker run -it --rm --net=host yandex/clickhouse-server
464
467
```
465
468
466
-
467
469
## License
468
470
469
471
This project is released under the permissive [ MIT license] ( LICENSE ) .
You can’t perform that action at this time.
0 commit comments