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(1y ago)1766.1k↓21%13MITPHPPHP &gt;=8.0CI passing

Since Apr 21Pushed 1y 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 3d ago

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

[![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

40

—

FairBetter than 86% of packages

Maintenance48

Moderate activity, may be stable

Popularity41

Moderate usage in the ecosystem

Community15

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

383d 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

103451.2k1](/packages/umbrellio-laravel-pg-extensions)[aura/sqlschema

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

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

DBML (database markup language) parser written on PHP8.

6419.3k2](/packages/butschster-dbml-parser)[itpathsolutions/dbstan

Database Standardization and Analysis Tool for Laravel

492.8k](/packages/itpathsolutions-dbstan)

PHPackages © 2026

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