Download the PHP package rasuvaeff/yii3-clickhouse-toolkit without Composer

On this page you can find all versions of the php package rasuvaeff/yii3-clickhouse-toolkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii3-clickhouse-toolkit

rasuvaeff/yii3-clickhouse-toolkit

Stable Version Total Downloads Build Static analysis Psalm Level License Русская версия

Yii3 config bridge for rasuvaeff/clickhouse-toolkit. Install it and a ClickHouse client, migration runner and the three migration console commands are wired into the container straight from CLICKHOUSE_* environment variables — no hand-written config/di.php boilerplate.

This package ships only configuration (config/di.php + config/params.php) and a small parameter factory. All the actual ClickHouse machinery lives in rasuvaeff/clickhouse-toolkit; this is the glue that makes it a one-line install in a Yii3 application.

Using an AI coding assistant? llms.txt has a compact API reference you can use.

Requirements

Installation

yiisoft/config discovers the bundled config plugin automatically.

What it wires

Once installed, the following container entries resolve from the merged config:

Container id Resolves to Notes
Rasuvaeff\ClickHouseToolkit\ClickHouseConfig ClickHouseConfig built from the params below
Rasuvaeff\ClickHouseToolkit\ClickHouseClientFactory ClickHouseClientFactory picks up an app-bound PSR-18 client / PSR-17 factories if present
SimPod\ClickHouseClient\Client\PsrClickHouseClient live client via ClickHouseClientFactory::create()
SimPod\ClickHouseClient\Client\ClickHouseClient alias → PsrClickHouseClient type-hint the interface
Rasuvaeff\ClickHouseToolkit\ClickHouseMigrationRunner migration runner needs migrationsPath (see below)
Rasuvaeff\ClickHouseToolkit\ClickHouseMigrationRunnerInterface alias → runner
Rasuvaeff\ClickHouseToolkit\ClickHouseMigrationGenerator migration generator needs migrationsPath
Rasuvaeff\ClickHouseToolkit\ClickHouseMutationBuilder mutation builder ALTER … UPDATE/DELETE, over the live client
Rasuvaeff\ClickHouseToolkit\ClickHousePartitionManager partition manager drop/attach/freeze/move partitions, over the live client

Three console commands are registered under yiisoft/yii-console:

Command Action
clickhouse:migrations:generate <description> create the next NNN_*.sql file
clickhouse:migrations:status show applied / pending / missing / diverged
clickhouse:migrations:migrate apply pending migrations

Configuration

Defaults come from environment variables. Override any of them by redefining the rasuvaeff/yii3-clickhouse-toolkit params key in your application config.

Param Env var Default
host CLICKHOUSE_HOST 127.0.0.1
port CLICKHOUSE_PORT 8123
database CLICKHOUSE_DB default
username CLICKHOUSE_USER default
password CLICKHOUSE_PASSWORD ''
secure CLICKHOUSE_SECURE false (accepts 1/true/on/yes)
migrationsPath CLICKHOUSE_MIGRATIONS_PATH unset — required for migrations

migrationsPath has no safe default: resolving the migration runner or generator without it throws a clear RuntimeException rather than silently operating relative to the working directory. Set the env var, or point the param at your migrations directory:

Usage

Type-hint the client (or the interface) anywhere in your app:

Run migrations from the Yii3 console:

Custom PSR-18 client (timeouts / TLS)

Bind your own configured PSR-18 client in the app; the bridge injects it into ClickHouseClientFactory automatically (it reads Psr\Http\Client\ClientInterface and the PSR-17 factories from the container when they are bound, otherwise falls back to auto-discovery):

Composition with backend packages

This bridge is the single binder of the toolkit client/config. Backend packages such as rasuvaeff/yii3-outbox-clickhouse consume ClickHouseClientFactory but never bind it, so installing both is conflict-free (verified against a real yiisoft/config merge). Their console commands and params co-exist under the standard recursive params merge.

Security

Examples

Runnable, server-independent examples live in examples/.

Development

No PHP/Composer on the host — everything runs in Docker via the composer:2 image.

License

BSD-3-Clause. See LICENSE.md.


All versions of yii3-clickhouse-toolkit with dependencies

PHP Build Version
Package Version
Requires php Version 8.3 - 8.5
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
rasuvaeff/clickhouse-toolkit Version ^1.6
simpod/clickhouse-client Version ^0.8.3
yiisoft/definitions Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rasuvaeff/yii3-clickhouse-toolkit contains the following files

Loading the files please wait ...