Laravel ClickHouse adds CH client integration, generation & execution of ClickHouse database migrations to the Laravel application.

Overview

Laravel ClickHouse

laravel-clickhouse

Discord Releases License

Introduction

Laravel ClickHouse database integration. This package includes generation and execution of the ClickHouse database migrations in the Laravel application.

Features

Installation

Pull in the package through Composer.

composer require cybercog/laravel-clickhouse

Setup

Add environment variables in .env file.

CLICKHOUSE_HOST=localhost
CLICKHOUSE_PORT=8123
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=
CLICKHOUSE_DATABASE=default

Configuration customization

Publish ClickHouse configuration.

php artisan vendor:publish --provider="Cog\Laravel\Clickhouse\ClickhouseServiceProvider" --tag=config

Edit config/clickhouse.php file.

Usage

ClickHouse client

You can use a singleton object smi2/phpClickHouse to query ClickHouse:

app(\ClickHouseDB\Client::class)->select(
    /* Query */
);

app(\ClickHouseDB\Client::class)->write(
    /* Query */
);

ClickHouse database migration

Create migration

php artisan make:clickhouse-migration create_example_table

New migration will be created in database/clickhouse-migrations directory.

Run migrations

php artisan clickhouse:migrate

To remove the interactive question during production migrations, you can use --force option.

php artisan clickhouse:migrate --force
Step

You can specify how many files need to be applied:

php artisan clickhouse:migrate --step=1

Value 0 is default — all files

Rollback migrations

Rolling back migrations is intentionally unavailable. Migrations should go only forward.

Changelog

Detailed changes for each release are documented in the CHANGELOG.md.

License

🌟 Stargazers over time

Stargazers over time

About CyberCog

CyberCog is a Social Unity of enthusiasts. Research the best solutions in product & software development is our passion.

CyberCog

You might also like...
A simple PHP GitHub API client, Object Oriented, tested and documented.

PHP GitHub API A simple Object Oriented wrapper for GitHub API, written with PHP. Uses GitHub API v3 & supports GitHub API v4. The object API (v3) is

A simple Object Oriented PHP Client for Termii SMS API

Termii Client A simple Object Oriented PHP Client for Termii SMS API. Uses Termii API. Requirements PHP = 7.2 Guzzlehttp ~6|~7 Installation Via Compo

oursms.app client library that allows you to send SMS

Oursms laravel client https://oursms.app client library that allows you to send SMS Installation Install oursms client with composer composer requir

Xendit REST API Client for PHP - Card, Virtual Account, Invoice, Disbursement, Recurring Payments, Payout, EWallet, Balance, Retail Outlets Services

Xendit REST API Client for PHP - Card, Virtual Account, Invoice, Disbursement, Recurring Payments, Payout, EWallet, Balance, Retail Outlets Services

PHP client for Kafka

A library to allow people to communicate to Kafka using plain PHP, compatible with Kafka v0.11+ (due to the way the protocol works).

DigitalOcean API v2 client for Symfony and API Platform

DigitalOcean Bundle for Symfony and API Platform DunglasDigitalOceanBundle allows using the DigitalOcean API from your Symfony and API Platform projec

php 8 client for the lemon.markets api

lemon.markets php client This repository contains a php 8+ compatible client for the https://lemon.markets API. The documentation of the API can be fo

PHP client for Microsoft Azure Face API.

Microsoft Azure Face API PHP client A PHP library that utilizes Azure Face REST API. Requirements PHP = 7.4 Installation composer require darmen/php-

Google PHP API Client Services

Google PHP API Client Services

Owner
cybercog
CyberCog is a Social Unity of enthusiasts. Developing best solutions in the field of product & software development is our passion.
cybercog
High performance Clickhouse PHP lib with progress tracking, parametric queries and compression support

Clickhousy High performance Clickhouse PHP library featuring: Tiny memory footprint based on static class (times better than smi2 client) High level m

Denys Golotiuk (hacking) 5 Dec 24, 2022
The Smart-ID PHP client can be used for easy integration of the Smart-ID solution to information systems or e-services

Smart-ID PHP client Introduction The Smart-ID PHP client can be used for easy integration of the Smart-ID solution to information systems or e-service

SK ID Solutions 16 Oct 23, 2022
Google-api-php-client - A PHP client library for accessing Google APIs

Google APIs Client Library for PHP Reference Docs https://googleapis.github.io/google-api-php-client/main/ License Apache 2.0 The Google API Client Li

Google APIs 8.4k Dec 30, 2022
OpenAI API Client is a component-oriented, extensible client library for the OpenAI API. It's designed to be faster and more memory efficient than traditional PHP libraries.

OpenAI API Client in PHP (community-maintained) This library is a component-oriented, extensible client library for the OpenAI API. It's designed to b

Mounir R'Quiba 6 Jun 14, 2023
A PHP package for handling client requests, sending response, database CRUD operations, among others, easily

Zam Zam helps to receive and process client request(s), return response to client with appropriate header and database CRUD operation for a more robus

SirMekus 3 Dec 31, 2022
Laravel Package for 1APP. Learn how to integrate our APIs to build a web or mobile integration to send and accept payments for your application and businesses.

1APP Laravel Library Learn how to integrate our APIs to build a web or mobile integration to accept payments, make payment of Bills and as well custom

O'Bounce Technologies 4 Jul 25, 2022
Adds a specific header to every response to disable Google's usage of your site in it's FLoC tracking method.

Go Unfloc Yourself Description A bundle for Symfony 5 that adds a Permissions-Policy header in all the responses to prevent the use of new Google's "F

(infinite) loophp 3 Feb 25, 2022
This library is for integration with Salesforce via REST API.

xsolve-pl/salesforce-client Introduction This library is for integration with Salesforce via REST API. Licence This library is under the MIT license.

Boldare / XSolve Sp. z o.o. 31 Oct 13, 2022
Laravel FTP client

LaravelFtp Laravel FTP client (or any other project that utilises has composer) This project is just called LaravelFtp because I am holding this packa

Dennis Smink 16 Nov 8, 2022
Spikkl API client for Laravel

Spikkl for Laravel Spikkl-php-laravel-client incorporates the Spikkl API into your Laravel or Lumen project. Requirements Get yourself a free Spikkl a

Spikkl 0 Jul 17, 2022