oralunal/laravel-clickhouse
A ClickHouse database driver for Laravel that connects your app to the column-oriented analytics engine, letting you run high-speed queries through Laravel's familiar query builder and Eloquent-style APIs.
Architecture fit. oralunal/laravel-clickhouse bridges Laravel's Eloquent/query builder/schema builder to a ClickHouse (columnar OLAP) backend. The correct architectural placement is an analytics/reporting sidecar alongside the primary OLTP database — not as a system of record. v4.2.0 is almost entirely a developer-experience and static-analysis release, which is a positive maturity signal: the maintainer is investing in typed schema correctness and code generation rather than surface area.
Integration feasibility. Low-friction. Composer install, register the service provider, add a clickhouse connection. The new make:clickhouse-model and make:clickhouse-migration generators remove the main onboarding pain point (hand-writing ClickHouse DDL by hand). The PHPStan/Larastan extension is opt-in and can be scoped.
Technical risk. No runtime or API breaking changes are apparent. The real risk is CI-visible:
Float32/Float64 columns on read-only connections, and MATERIALIZED/ALIAS columns, are now correctly inferred as nullable. Any consumer code that previously passed PHPStan at a given level may now fail. This is functionally a breaking change for teams gating merges on PHPStan — budget triage time.PHPStan\ConnectionConfig::isReadOnly() in favor of hasReadOnlyClickHouseConnection(). Blast radius is limited to teams that extend or wrap the PHPStan extension, but it should be tracked against a removal deadline.Key questions.
MATERIALIZED or ALIAS columns in production schema? If so, do our models attempt inserts into them?ConnectionConfig anywhere, or only consume the shipped extension?Stack fit. Requires confirmation of PHP, Laravel, PHPStan, and Larastan version constraints against our current pins — the release notes do not state them. Teams not using PHPStan/Larastan get the generators and bug fixes with essentially zero risk; teams using them get the bulk of the value and the bulk of the upgrade effort.
Migration path. composer require --with-all-dependencies from 4.1.x to 4.2.0 in a branch. The lc-upgrade-3x-to-4x command is irrelevant unless we are coming from 3.x, and its refinement (suggesting schema:dump only for tables lacking a migration) is a minor correctness improvement to that path.
Compatibility. Two touchpoints to verify before merge: (1) whether the extension's cache-disabling behavior conflicts with our existing Larastan configuration, and (2) whether new nullable inferences collide with hand-written model docblocks or @property annotations we maintain.
Sequencing.
@property update).ConnectionConfig::isReadOnly() appears in our code, migrate to hasReadOnlyClickHouseConnection() in the same PR.Maintenance. Low steady-state effort, but do not auto-merge minor bumps. This release demonstrates that minors can change static-analysis outcomes; treat each bump as requiring a CI diff review. Pin to minor versions and upgrade deliberately.
Support. GitHub issues only, no commercial backing. Nominate an internal owner — realistically the data/analytics platform team, not general application support — so ClickHouse-specific questions have a routing destination.
Scaling. The package is a thin adapter; scaling is a ClickHouse cluster concern (sharding, replicas, MergeTree design). Read-only connection support is the operationally interesting capability: it lets analytics reads target a replica while writes go to the primary, which is the pattern most teams will want. Parallel::get()/getRows() allow query fan-out, and the v4.2.0 fix removing the single-model restriction makes them usable for mixed result sets.
Failure modes to watch.
schema:dump guidance mitigate but do not eliminate this; it remains the classic failure for this class of package.MATERIALIZED/ALIAS columns — these are not insertable, and generated models may include them. Verify generated models before using them on a write path.Ramp-up. A Laravel developer can produce a working model and migration in under a day with the new generators. The real learning curve is ClickHouse semantics — MergeTree engines, ordering keys, granularity() index definitions, asynchronous mutations, and eventual consistency. Budget a short internal primer; the generators remove syntax friction but not conceptual friction.
Recommendation. Adopt. This is a low-risk minor release with meaningful DX gains. Gate the rollout on a static-analysis diff rather than on the test suite alone, and track the ConnectionConfig::isReadOnly() deprecation for removal in v5.
How can I help you explore Laravel packages today?