Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"minimum-stability": "stable",
"require": {
"php": ">=8.4",
"psr/http-client": "^1.0",
"utopia-php/client": "^0.1|^0.2",
"utopia-php/database": "5.*|6.0.*",
"utopia-php/query": "0.1.*"
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions src/Usage/Adapter/ClickHouse.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use DateTime;
use DateTimeZone;
use Exception;
use Psr\Http\Client\ClientInterface;
use Throwable;
use Utopia\Client;
use Utopia\Client\Adapter\Curl\Client as CurlAdapter;
Expand Down Expand Up @@ -93,7 +94,7 @@ class ClickHouse extends SQL
/** @var bool Whether to use HTTPS for ClickHouse HTTP interface */
private bool $secure = false;

private Client $client;
private ClientInterface $client;

private RequestFactory $requestFactory;

Expand Down Expand Up @@ -148,17 +149,19 @@ class ClickHouse extends SQL
* @param string $password ClickHouse password (default: '')
* @param int $port ClickHouse HTTP port (default: 8123)
* @param bool $secure Whether to use HTTPS (default: false)
* @param Client|null $client HTTP transport. Defaults to a cURL client
* with persistent connection reuse. Inject your own to control timeouts,
* TLS, or retries — e.g. wrap an adapter in `Utopia\Client\Decorator\Retry`.
* @param ClientInterface|null $client PSR-18 HTTP transport. Defaults to a
* cURL client with persistent connection reuse. Inject your own to control
* timeouts, TLS, or retries — e.g. wrap an adapter in
* `Utopia\Client\Decorator\Retry`, or pass a `Utopia\Client\Pool` to share a
* bounded set of connections across concurrent (coroutine) callers.
*/
public function __construct(
string $host,
string $username = 'default',
string $password = '',
int $port = self::DEFAULT_PORT,
bool $secure = false,
?Client $client = null
?ClientInterface $client = null
) {
$this->validateHost($host);
$this->validatePort($port);
Expand Down
Loading