Awesome ClickHousePHP

smi2/phpClickHouse

⭐ 854 PHP repository created 2016-07-18

The project smi2/phpClickHouse is a PHP wrapper for ClickHouse, a columnar database management system. It provides a comprehensive interface to interact with ClickHouse servers using PHP, supporting PHP versions 7.1 and above. The wrapper is designed to facilitate asynchronous and parallel queries, bulk inserts from CSV files, and HTTP compression for efficient data handling. It supports features like finding active hosts, checking clusters, SQL conditions and templates, and managing table and database sizes. The library also offers functionalities such as listing partitions, truncating tables in clusters, inserting arrays as columns, and retrieving master node replicas in clusters. It supports asynchronous progress functions and stream read/write operations with closure functions. The wrapper is dependency-free except for Curl and supports various PHP versions with different stable releases. It allows easy connection setup with configuration arrays, supports timeout settings, and provides methods to ping the server to check connectivity. Users can perform common database operations such as showing tables, creating tables with specific engines, inserting data including UInt64 types, selecting data with various fetch options, and dropping tables. Advanced features include asynchronous parallel queries and batch file inserts, error handling for asynchronous operations, and enabling HTTP compression for bulk inserts to optimize performance. The library also supports connection configurations without specifying ports explicitly and provides human-readable size information for tables and databases. It includes support for SQL WHERE IN clauses using local CSV files and binding parameters for queries. Overall, smi2/phpClickHouse is a robust and efficient PHP client for ClickHouse, designed to leverage the database's capabilities with ease and performance in PHP applications, making it suitable for developers needing to integrate ClickHouse with PHP environments.

https://github.com/smi2/phpClickHouse

asynchronous-queriesbindingsbulk-insertsclickhousecluster-managementcsvdatabase-sizeerror-handlinghttp-compressionparallel-queriespartitionsperformance-optimizationphpphp-clickhousephp-clickhouse-wrappersql-conditionsstream-read/writetable-sizeuint64wrapper

Also in PHP

the-tinderbox/ClickhouseBuilder

ClickhouseBuilder is a PHP fluent query builder designed to simplify the construction and execution of complex SQL queries for Clickhouse databases, with integration support for Laravel and Lumen frameworks.

cybercog/laravel-clickhouse

Laravel ClickHouse is a package that integrates ClickHouse database client and migration support into Laravel applications, enabling efficient management of ClickHouse databases within the Laravel framework.

FriendsOfDoctrine/dbal-clickhouse

Doctrine DBAL driver for ClickHouse database enabling seamless integration with Symfony and other frameworks using Doctrine, supporting advanced database operations and custom types.