PHPackages                             kafkiansky/phpclick - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. kafkiansky/phpclick

ActiveLibrary[Queues &amp; Workers](/categories/queues)

kafkiansky/phpclick
===================

ClickHouse async php client.

0.3.0(7mo ago)327.7k↓22%1[1 PRs](https://github.com/kafkiansky/PHPClick/pulls)1MITPHPPHP ^8.2CI passing

Since Jun 30Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/kafkiansky/PHPClick)[ Packagist](https://packagist.org/packages/kafkiansky/phpclick)[ RSS](/packages/kafkiansky-phpclick/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (7)Used By (1)

Installation
============

[](#installation)

This package can be installed as a [Composer](https://getcomposer.org/) dependency.

```
composer require kafkiansky/phpclick
```

This package requires PHP 8.2 or later.

Usage
-----

[](#usage)

- [From memory](#from-memory)
- [From resource](#from-resource)
- [Query builder](#query-builder)
- [Types](#types)

#### From Memory

[](#from-memory)

This client is designed to be inserted into clickhouse in large batches. `RowBinary` mode is used for insertion. This means that you must know the types of table columns and their order.

For example, let's look at the following table DDL:

```
CREATE TABLE IF NOT EXISTS logs (
    `LogName` String CODEC(ZSTD(1)),
    `LogTime` DateTime64(9) CODEC(Delta(8), ZSTD(1)),
    `LogAttributes` Map(LowCardinality(String), String) CODEC(ZSTD(1)),
    `LogUserId` Nullable(Int64)
)   ENGINE = MergeTree()
    ORDER BY (LogName, toUnixTimestamp(LogTime))
;
```

You can insert directly from memory using `Row`:

```
