Skip to content

Commit 98e90d6

Browse files
authored
Merge pull request #9 from SimonFrings/loop
Update example to new eventloop and new clickhouse API
2 parents 8431192 + ab7f89d commit 98e90d6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,17 @@ Once [installed](#install), you can use the following code to connect to your
3434
local ClickHouse database and send some queries:
3535

3636
```php
37-
$loop = React\EventLoop\Factory::create();
38-
$client = new Clue\React\ClickHouse\Client('http://localhost:8123/', $loop);
37+
<?php
38+
39+
require __DIR__ . '/vendor/autoload.php';
40+
41+
$client = new Clue\React\ClickHouse\ClickHouseClient('http://localhost:8123/');
3942

4043
$client->query('SELECT id, name FROM users')->then(function (Clue\React\ClickHouse\Result $result) {
4144
var_dump($result);
4245
}, function (Exception $e) {
4346
echo 'Error: ' . $e->getMessage() . PHP_EOL;
4447
});
45-
46-
$loop->run();
4748
```
4849

4950
## Install

0 commit comments

Comments
 (0)