Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpclickhouse Laravel Package

smi2/phpclickhouse

PHP client for ClickHouse with an easy, fluent API. Supports queries and inserts, result sets, bindings, and connection configuration for fast analytics workflows. Suitable for Laravel and standalone PHP apps needing reliable ClickHouse access.

View on GitHub
Deep Wiki
Context7

layout: default title: Settings & Configuration

< Back to Home

Settings & Configuration

Setting values

Three ways to configure settings:

// 1. In config array
$config = [
    'host'     => 'x',
    'port'     => '8123',
    'username' => 'x',
    'password' => 'x',
    'settings' => ['max_execution_time' => 100],
];
$db = new ClickHouseDB\Client($config);

// 2. Via constructor second argument
$db = new ClickHouseDB\Client($config, ['max_execution_time' => 100]);

// 3. Via set method
$db->settings()->set('max_execution_time', 100);

// 4. Bulk apply
$db->settings()->apply([
    'max_execution_time' => 100,
    'max_block_size'     => 12345,
]);

// Check value
$db->settings()->getSetting('max_execution_time'); // 100

See example/exam10_settings.php.

Max execution time

$db->settings()->max_execution_time(200); // seconds

HTTPS

$db->settings()->https();

SSL CA

$config = [
    'host'  => 'cluster.clickhouse.dns.com',
    'port'  => '8123',
    'sslCA' => '/path/to/ca.pem',
];

Auth methods

// In config
$config = [
    'host'        => 'host.com',
    'port'        => '8123',
    'username'    => 'default',
    'password'    => '',
    'auth_method' => 1, // see constants below
];
Constant Value Description
AUTH_METHOD_HEADER 1 X-ClickHouse-User/Key headers (default)
AUTH_METHOD_QUERY_STRING 2 URL parameters
AUTH_METHOD_BASIC_AUTH 3 HTTP Basic Auth

Sessions

// Create new session
$db->useSession();
$session_id = $db->getSession();

$db->write('CREATE TEMPORARY TABLE IF NOT EXISTS temp_session_test (number UInt64)');
$db->write('INSERT INTO temp_session_test SELECT number * 1234 FROM system.numbers LIMIT 30');

// Reconnect with same session
$db->useSession($session_id);

Extremes

$db->enableExtremes(true);

HTTP compression

$db->enableHttpCompression(true);
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle