Skip to content

SimonFrings/reactphp-clickhouse-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

clue/reactphp-clickhouse

Blazing fast access to your ClickHouse database, built on top of ReactPHP.

ClickHouse is a fast open-source OLAP database management system (DBMS). It is column-oriented and allows to generate analytical reports using SQL queries in real-time. Its efficient design and fast operation makes it an ideal candidate when processing very large amounts of data. This library provides you a simple API to work with your ClickHouse database from within PHP. It enables you to query and insert data through a very efficient way. It is written in pure PHP and does not require any extensions.

  • Async execution of queries - Send any number of queries (SQL) to ClickHouse in parallel and process their responses as soon as results come in. The Promise-based design provides a sane interface to working with async results.
  • Streaming queries - Memory-efficient processing of millions of records per second.
  • Lightweight, SOLID design - Provides a thin abstraction that is just good enough and does not get in your way.
  • Good test coverage - Comes with an automated test suite and is regularly tested against actual ClickHouse databases in the wild.

Table of contents

Quickstart example

Once installed, you can use the following code to connect to your local ClickHouse database and send some queries:

<?php

require __DIR__ . '/vendor/autoload.php';

$client = new Clue\React\ClickHouse\ClickHouseClient('http://localhost:8123/');

$client->query('SELECT id, name FROM users')->then(function (Clue\React\ClickHouse\Result $result) {
    var_dump($result);
}, function (Exception $e) {
    echo 'Error: ' . $e->getMessage() . PHP_EOL;
});

Install

A clue·access project

This project is currently under active development, you're looking at a temporary placeholder repository.

The code is available in early access to my sponsors here: https://github.com/clue-access/reactphp-clickhouse

Do you sponsor me on GitHub? Thank you for supporting sustainable open-source, you're awesome! ❤️ Have fun with the code! 🎉

Seeing a 404 (Not Found)? Sounds like you're not in the early access group. Consider becoming a sponsor on GitHub for early access. Check out clue·access for more details.

This way, more people get a chance to take a look at the code before the public release.

Rock on 🤘

License

This project will be released under the permissive MIT license.

Did you know that I offer custom development services and issuing invoices for sponsorships of releases and for contributions? Contact me (@clue) for details.

About

Blazing fast access to your ClickHouse database, built on top of @reactphp.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published