PHP code example of rasuvaeff / yii3-clickhouse-toolkit
1. Go to this page and download the library: Download rasuvaeff/yii3-clickhouse-toolkit library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rasuvaeff / yii3-clickhouse-toolkit example snippets
use SimPod\ClickHouseClient\Client\ClickHouseClient;
final readonly class ReportService
{
public function __construct(private ClickHouseClient $client) {}
public function activeUsers(): int
{
return (int) $this->client->select('SELECT count() FROM events')->getRows()[0]['count()'];
}
}