serkarn / clickhouse-migrations
适用于laravel/lumen的ClickHouse迁移
0.1.2
2019-03-28 14:04 UTC
Requires
- php: ^7.1.3
- illuminate/console: 5.7.*
- illuminate/contracts: 5.7.*
- illuminate/support: 5.7.*
- league/flysystem: ^1.0.8
- smi2/phpclickhouse: ^1.3
- symfony/finder: ^4.1
This package is auto-updated.
Last update: 2024-09-29 02:54:56 UTC
README
ClickHouse是一个开源的列式数据库管理系统,能够使用SQL查询实时生成分析数据报告。该库适用于Laravel。
安装
composer require serkarn/laravel-clickhouse-migrations
使用方法
配置 /config/database.php
clickhouse和迁移设置的示例
...
'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'),
],
...
注册提供者
'providers' => [
...
\Serkarn\ClickhouseMigrations\ClickhouseProvider::class,
...
],
使用方法
创建新的迁移
php artisan clickhouse:migration:create {name}
上行迁移
php artisan clickhouse:migrate
取消上一个迁移
php artisan clickhouse:migrate --down
使用技术
- https://github.com/smi2/phpClickHouse - PHP ClickHouse包装器