glushkovds/clickhouse-builder
A fluent ClickHouse query builder for PHP and Laravel, providing an Eloquent-style API for composing SELECT, INSERT, and other SQL statements, with support for ClickHouse-specific clauses, expressions, and database operations.
Architecture fit
DB::table() idiom, so it slots into an existing service layer without introducing a new mental model for the team. Cognitive adoption cost is near zero.Integration feasibility
composer require plus config publish. Low effort, low blast radius.Technical risk
async_insert, lightweight deletes, settings profiles, cluster DDL). Small packages fall behind server releases.Key questions for the spike
async_insert? Any deduplication support?Stack fit
AnalyticsQueryGateway interface in the domain layer with a ClickhouseBuilderAdapter implementation. The fluent API never leaks past that boundary; callers see intent-shaped methods (eventsByDay, funnelSteps), not builder chains.Migration path
smi2/clickhouse-php or the official client behind the same interface. The adapter pattern makes this a half-day swap.Compatibility
Sequencing
Maintenance
Support
Scaling
max_execution_time, max_memory_usage, and result limits at the config layer, not per call site.Failure modes
LIMIT is misconfigured or silently injected.ReplacingMergeTree or insert tokens if the write path is used.Ramp-up
Recommendation: Conditional adopt. Acceptable as a read-path query builder behind a mandatory adapter and pinned versions; not acceptable as an unmediated, codebase-wide dependency given single-maintainer status and zero dependents.
How can I help you explore Laravel packages today?