Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Php Clickhouse Schema Builder

Php Clickhouse Schema Builder Laravel Package

glushkovds/php-clickhouse-schema-builder

A PHP library for defining ClickHouse database schemas with a fluent API. Build tables, columns, and indexes programmatically, then generate the SQL needed for migrations, setup, or infrastructure scripts. Lightweight and framework-agnostic.

Deep Wiki
Context7

At a glance

Frequently asked questions about Php Clickhouse Schema Builder
What is glushkovds/php-clickhouse-schema-builder used for?
It is a PHP library for defining ClickHouse database schemas with a fluent, object-oriented API. You build tables, columns, and indexes programmatically, then generate the SQL needed for migrations, initial setup, or infrastructure scripts. It is described as lightweight and framework-agnostic, so it can be used in any PHP project.
How do I install php-clickhouse-schema-builder with Composer?
Install it via Composer with composer require glushkovds/php-clickhouse-schema-builder. Then include Composer's autoloader in your script or rely on your framework's bootstrap. No Laravel service provider is mentioned, so no extra registration is required in a standard setup.
Does php-clickhouse-schema-builder work with Laravel?
Yes, it is a framework-agnostic PHP library, so it can be installed in a Laravel application via Composer and used inside commands, migrations, or setup scripts. There is no Laravel-specific package or service provider described, so you would call it directly from your own code. It should work with any Laravel version that runs a compatible PHP version.
How do I define a ClickHouse table using a fluent API in PHP?
You create a schema builder instance and chain methods to define the table name, columns, column types, and indexes. The library is designed around a fluent interface, so the definition reads like a sequence of method calls. After building the schema, you call a generation method to output the ClickHouse SQL.
How do I generate CREATE TABLE SQL for ClickHouse with this package?
Build your table definition using the fluent API, then generate the SQL from the builder object. The generated SQL is intended for migrations, setup scripts, or infrastructure automation. Because the library appears focused on SQL generation rather than connectivity, you run the SQL through your normal ClickHouse client or migration tooling.
Which ClickHouse features does the schema builder support, such as engines and indexes?
The package is described as supporting tables, columns, and indexes through its fluent API. ClickHouse-specific table engines and index definitions are part of schema definition, but the exact supported options depend on the library's current implementation. Check the README and source for the precise list of supported column types, engines, and index clauses.
Can I use php-clickhouse-schema-builder inside Laravel migrations?
You can use it within a Laravel migration or a custom Artisan command to produce ClickHouse SQL. Laravel's default migration API targets relational databases, so you would typically generate the SQL with this package and execute it via a raw statement or your ClickHouse client. Keeping ClickHouse migrations separate from your relational migrations is usually clearer.
Is php-clickhouse-schema-builder framework-agnostic and testable?
Yes, the library is explicitly described as lightweight and framework-agnostic, so it does not depend on Laravel or Symfony components. That makes it easy to unit test schema definitions by asserting the generated SQL strings. You can use it in plain PHP scripts, CLI tools, or any framework.
Does the package connect to ClickHouse or validate schemas against a live database?
The described purpose is schema definition and SQL generation, not database connectivity. It builds the SQL for migrations, setup, or infrastructure scripts, and you execute that SQL with a ClickHouse client or driver. For live validation, run the generated statements against a ClickHouse instance in a staging environment.
How does this compare to other ClickHouse PHP packages, and is it maintained?
Alternatives include general ClickHouse PHP clients and Laravel-specific ClickHouse integrations that provide query builders or Eloquent-like models. This package focuses narrowly on schema definition and SQL generation, so it can complement a client rather than replace one. Because repository details are limited here, check Packagist and GitHub for release activity before adopting it in production.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons