PHPackages                             glushkovds/php-clickhouse-schema-builder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. glushkovds/php-clickhouse-schema-builder

ActiveLibrary[Database &amp; ORM](/categories/database)

glushkovds/php-clickhouse-schema-builder
========================================

PHP library for generating DDL statements for ClickHouse

v1.1.1(11mo ago)1474.2k↑16.6%12MITPHPPHP &gt;=8.0CI passing

Since Apr 21Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/glushkovds/php-clickhouse-schema-builder)[ Packagist](https://packagist.org/packages/glushkovds/php-clickhouse-schema-builder)[ Docs](https://github.com/glushkovds/php-clickhouse-schema-builder)[ RSS](/packages/glushkovds-php-clickhouse-schema-builder/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (2)

[![Tests](https://github.com/glushkovds/php-clickhouse-schema-builder/actions/workflows/test.yml/badge.svg)](https://github.com/glushkovds/php-clickhouse-schema-builder/actions/workflows/test.yml/badge.svg)

ClickHouse schema builder written in PHP
========================================

[](#clickhouse-schema-builder-written-in-php)

Requirements
------------

[](#requirements)

- PHP 8.0

Installation
------------

[](#installation)

**1.** Install via composer

```
$ composer require glushkovds/php-clickhouse-schema-builder
```

Usage
-----

[](#usage)

```
use PhpClickHouseSchemaBuilder\Tables\MergeTree;

$ddl = (new MergeTree('some_table'))
    ->dbName('some_db') // optional, for replicated table engine
    ->onCluster('some_cluster')
    ->columns(fn(MergeTree $t) => [
        $t->string('col_one')->default('5')->comment('some comment'),
        $t->datetime('at'),
    ])
    ->orderBy('col_one')
    ->partition('toDate(at)')
    ->ttl('at', '1 month')
    ->engine((new Engine(Engine::REPLACING_MERGE_TREE))->replicated(), 'col_one')
    ->settings(['ttl_only_drop_parts' => 1, 'index_granularity' => 8192])
    ->compile();
```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance52

Moderate activity, may be stable

Popularity40

Moderate usage in the ecosystem

Community12

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~14 days

Total

5

Last Release

337d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c9d6b042523ed95a3becf0be5153841aabdedb17515aa83057fa5f0701c4dee?d=identicon)[glushkovds](/maintainers/glushkovds)

---

Top Contributors

[![glushkovds](https://avatars.githubusercontent.com/u/35626465?v=4)](https://github.com/glushkovds "glushkovds (6 commits)")

---

Tags

phpschemabuilderclickhouseddl

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/glushkovds-php-clickhouse-schema-builder/health.svg)

```
[![Health](https://phpackages.com/badges/glushkovds-php-clickhouse-schema-builder/health.svg)](https://phpackages.com/packages/glushkovds-php-clickhouse-schema-builder)
```

###  Alternatives

[umbrellio/laravel-pg-extensions

Extensions for Postgres Laravel

102426.5k1](/packages/umbrellio-laravel-pg-extensions)[basemkhirat/elasticsearch

Laravel, Lumen and Native php elasticseach query builder to build complex queries using an elegant syntax

402312.0k](/packages/basemkhirat-elasticsearch)[aura/sqlschema

Provides facilities to read table names and table columns from a database using PDO.

41234.1k4](/packages/aura-sqlschema)[butschster/dbml-parser

DBML (database markup language) parser written on PHP8.

6416.8k2](/packages/butschster-dbml-parser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
