Giter Club home page Giter Club logo

laravel-clickhouse's Introduction

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

laravel-clickhouse's People

Contributors

antonkomarev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel-clickhouse's Issues

Connection to Clickhouse with .pem certificate

I use a cluster in Yandex cloud with a clickhouse.

To connect, in addition to the login / password / port / host, a full verification mod is used. To do this, you must specify the path to the CA.pem file.

Is it possible to specify the path to the certificate in the config?

Example of data required for connection:
alt text

Support for Laravel 10

Please add support for Laravel 10. Currently it does not want to install for that version

Error when L10->L11 update

  "require": {
      "php": "^8.3",
      "cybercog/laravel-clickhouse": "dev-master",
      "laravel/framework": "^11.0"
  }
php artisan package:discover --ansi
                                                                                                                            
The command defined in "Cog\Laravel\Clickhouse\ConsoleCommand\MakeClickhouseMigrationCommand" cannot have an empty name.  

Not installing now

I am working on a Laravel 8 project with PHP 7.4 on my local machine, using the CyberLog Laravel ClickHouse package. However, when I tried to migrate the project to the server and perform 'composer install', I encountered an issue. It seems that the package is not supported on PHP 7.4; it requires PHP 8. How can I install this package with PHP 7.4?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.