smi2 / phpClickHouse

php ClickHouse wrapper
MIT License
750 stars 139 forks source link

Async insert without CSV? #225

Open kicks66 opened 2 months ago

kicks66 commented 2 months ago

Is it possible to have a method for asynchronous insert from an array of data? I would like to write to my clickhouse instance without waiting for a response from the DB.

uksarkar commented 2 months ago

@kicks66 it's possible,

$client = new Client();

// adjust settings accordingly
$client->settings()->apply([
        "async_insert" => 1,
        "wait_for_async_insert" => 0
]);

$client->insert(.....);