Skip to content

Commit daa8f98

Browse files
authored
Merge pull request #12 from SimonFrings/quickstart
Change `$client` to `$db` in quickstart example
2 parents acbe9bb + f01047b commit daa8f98

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,13 @@ local ClickHouse database and send some queries:
6969

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

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

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+
}
7679
}, function (Exception $e) {
7780
echo 'Error: ' . $e->getMessage() . PHP_EOL;
7881
});
@@ -463,7 +466,6 @@ You can run a temporary ClickHouse database server in a Docker container like th
463466
$ docker run -it --rm --net=host yandex/clickhouse-server
464467
```
465468

466-
467469
## License
468470

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

0 commit comments

Comments
 (0)