trueifnotfalse / clickhouse-migrations
Clickhouse migrations for laravel/lumen
0.1.0
2024-03-06 06:19 UTC
Requires
- php: >=7.4
- illuminate/console: ^8.0 || ^9.0
- illuminate/contracts: ^8.0 || ^9.0
- illuminate/support: ^8.0 || ^9.0
- smi2/phpclickhouse: ^1.3
- symfony/finder: ^5.0 || ^6.0
This package is not auto-updated.
Last update: 2024-12-11 10:12:29 UTC
README
ClickHouse is an open source column-oriented database management system capable of real time generation of analytical data reports using SQL queries.
Library is suitable for Laravel / Lumen.
Installing
composer require sagirba/clickhouse-migrations
Usage
Configure /config/database.php
Example for clickhouse and migrations settings:
...
'clickhouse' => [
'host' => env('CLICKHOUSE_HOST', 'localhost'),
'port' => env('CLICKHOUSE_PORT', 8123),
'username' => env('CLICKHOUSE_USER', 'default'),
'password' => env('CLICKHOUSE_PASSWORD', ''),
'options' => [
'database' => env('CLICKHOUSE_DATABASE', 'default'),
'timeout' => 1,
'connectTimeOut' => 2,
],
],
'clickhouse-migrations' => [
'dir' => env('CLICKHOUSE_MIGRATION_DIR', '/database/clickhouse-migrations/'),
'table' => env('CLICKHOUSE_MIGRATION_TABLE_NAME', 'migrations'),
],
...
Register provider
Laravel
'providers' => [
...
\Sagirba\ClickhouseMigrations\ClickhouseProvider::class,
...
],
Lumen
$app->register(Sagirba\ClickhouseMigrations\ClickhouseProvider::class);
Usage
Create new migration
php artisan clickhouse:migration:create {name}
Up migrations
php artisan clickhouse:migrate
Down last migration
php artisan clickhouse:migrate --down
Built With
- https://github.com/smi2/phpClickHouse - PHP ClickHouse wrapper