Skip to content
SeasClick
Branch: master
Clone or download
Pull request Compare This branch is 14 commits behind SeasX:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
tests
travis
.gitignore
.gitmodules
.travis.yml
CREDITS
EXPERIMENTAL
LICENSE
README.md
SeasClick.cpp
config.m4
config.w32
php7_wrapper.h
php_SeasClick.h
typesToPhp.cpp
typesToPhp.hpp

README.md

SeasClick

Build Status

PHP client for Yandex ClickHouse,Based on ClickHouse C++ client

ClickHouse

Supported data types

  • Array(T) Multidimensional arrays are not supported at this time
  • Date
  • DateTime
  • Enum8, Enum16
  • FixedString(N)
  • Float32, Float64
  • Nullable(T)
  • String
  • UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64

Supported PHP version

PHP 5.5+

Performance

image

This performance test demo is compared to phpclickhouse

Install

git clone https://github.com/SeasX/SeasClick.git
git submodule init
git submodule update
cd SeasClick
phpize
./configure
make && make install

Example

<?php
$config = [
    "host" => "clickhouse",
    "port" => 9000,
    "compression" => true
];

clientTest($config);

function clientTest($config)
{
    $deleteTable = true;
    $client = new SeasClick($config);

    $client->execute("CREATE DATABASE IF NOT EXISTS test");

    testArray($client, $deleteTable);
}

function testArray($client, $deleteTable = false) {
    $client->execute("CREATE TABLE IF NOT EXISTS test.array_test (string_c String, array_c Array(Int8), arraynull_c Array(Nullable(String))) ENGINE = Memory");

    $client->insert("test.array_test", [
        'string_c', 'array_c', 'arraynull_c'
    ], [
        ['string_c1', [1, 2, 3], ['string']],
        ['string_c2', [4, 5, 6], [null]]
    ]);

    $result = $client->select("SELECT {select} FROM {table}", [
        'select' => 'string_c, array_c, arraynull_c',
        'table' => 'test.array_test'
    ]);
    var_dump($result);

    if ($deleteTable) {
        $client->execute("DROP TABLE {table}", [
            'table' => 'test.array_test'
        ]);
    }
}

More examples

Support

SeasX Group

You can’t perform that action at this time.