Skip to content

Commit d408b3e

Browse files
committed
refactor(clickhouse): drop empty Feature\OLAP marker
The interface declared no methods, was inspected nowhere, and pulled no weight at runtime or in the type system. Every sibling in `Feature/*` declares Statement-returning method signatures, but OLAP modifiers are intrinsic to the column/table builder shape and can't be expressed at the Schema level. Dialect-scoping is fully preserved by `Column\ClickHouse` / `Table\ClickHouse` / `Forwarder\ClickHouse` carrying the modifier methods natively — calling them on a non-ClickHouse builder is a clean type-system error, not a runtime exception.
1 parent 951783c commit d408b3e

3 files changed

Lines changed: 3 additions & 30 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,7 @@ $result = $schema->table('events')
20332033

20342034
ClickHouse uses `Nullable(type)` wrapping for nullable columns, `Enum8(...)` for enums, `Tuple(Float64, Float64)` for points, and `TYPE minmax GRANULARITY 3` for indexes. Foreign keys, stored procedures, triggers, generated columns, and CHECK constraints throw `UnsupportedException`.
20352035

2036-
Supports the `TableComments`, `ColumnComments`, `DropPartition`, `Views`, `Databases`, and `OLAP` interfaces.
2036+
Supports the `TableComments`, `ColumnComments`, `DropPartition`, `Views`, and `Databases` interfaces.
20372037

20382038
**Engine selection** — choose from 10 variants of the `Engine` enum:
20392039

@@ -2195,7 +2195,7 @@ $schema->table('events')
21952195

21962196
The expression is emitted verbatim and must not be empty or contain a semicolon. `SAMPLE BY` only applies to engines that take an `ORDER BY` clause (the MergeTree family); using it with `Memory`, `Log`, `TinyLog`, or `StripeLog` throws `UnsupportedException`. The `sampleBy()` method is only available on the ClickHouse builder.
21972197

2198-
These OLAP-shaped modifiers are exposed on the ClickHouse dialect via the `Feature\OLAP` marker interface. Dialect-specific Column/Table subclasses surface the methods only when the underlying dialect implements the feature — so calling `->lowCardinality()` or `->sampleBy()` on a `MySQL`, `PostgreSQL`, `SQLite`, or `MongoDB` builder fails at the type level, with no runtime branch needed.
2198+
These OLAP-shaped modifiers live on the ClickHouse-specific `Column\ClickHouse` and `Table\ClickHouse` builders. Because the methods only exist on the dialect's own builder subclasses, calling `->lowCardinality()` or `->sampleBy()` on a `MySQL`, `PostgreSQL`, `SQLite`, or `MongoDB` builder fails at the type level, with no runtime branch needed.
21992199

22002200
### SQLite Schema
22012201

src/Query/Schema/ClickHouse.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
use Utopia\Query\Schema\Feature\ColumnComments;
1212
use Utopia\Query\Schema\Feature\Databases;
1313
use Utopia\Query\Schema\Feature\DropPartition;
14-
use Utopia\Query\Schema\Feature\OLAP;
1514
use Utopia\Query\Schema\Feature\TableComments;
1615
use Utopia\Query\Schema\Feature\Views;
1716

18-
class ClickHouse extends Schema implements TableComments, ColumnComments, DropPartition, Views, Databases, OLAP
17+
class ClickHouse extends Schema implements TableComments, ColumnComments, DropPartition, Views, Databases
1918
{
2019
use QuotesIdentifiers;
2120
use Trait\Databases;

src/Query/Schema/Feature/OLAP.php

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)