You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Regex** — uses `match()` function instead of `REGEXP`.
1474
1474
1475
-
**UPDATE/DELETE** — compiles to `ALTER TABLE ... UPDATE/DELETE` with mandatory WHERE:
1475
+
**Time bucketing** — groups rows into fixed-width windows on a timestamp column. Allowed intervals: `1m`, `5m`, `15m`, `1h`, `1d`, `1w`, `1M`. Compiles to `toStartOfMinute / toStartOfFiveMinutes / toStartOfFifteenMinutes / toStartOfHour / toStartOfDay / toStartOfWeek / toStartOfMonth`:
1476
+
1477
+
```php
1478
+
$result = (new Builder())
1479
+
->from('events')
1480
+
->selectRaw('toStartOfHour(`time`) AS `bucket`')
1481
+
->count('*', 'cnt')
1482
+
->groupByTimeBucket('time', '1h')
1483
+
->orderByRaw('`bucket` ASC')
1484
+
->build();
1485
+
1486
+
// SELECT COUNT(*) AS `cnt`, toStartOfHour(`time`) AS `bucket`
1487
+
// FROM `events`
1488
+
// GROUP BY toStartOfHour(`time`)
1489
+
// ORDER BY `bucket` ASC
1490
+
```
1491
+
1492
+
Other dialects throw `UnsupportedException` from `compileGroupByTimeBucket`. Re-emit the bucket function via `selectRaw` / `orderByRaw` when you need to reference it in the SELECT list or ORDER BY (same pattern as `groupByRaw`).
1493
+
1494
+
**Named-typed bindings** — opt into ClickHouse `{name:Type}` placeholders for safe parameterization over the HTTP interface. Off by default; positional `?` placeholders remain the default and behave identically to every other dialect:
Unregistered columns fall through to value-based inference: `int → Int64`, `float → Float64`, `bool → UInt8`, `null → Nullable(String)`, `DateTimeInterface → DateTime64(3)`, everything else → `String`. Register types via `withParamType($column, $type)` or `withParamTypes($map)` whenever the inference rule doesn't match the column's ClickHouse declaration. The positional `$bindings` array is still exposed on the resulting `Statement` for callers that prefer it.
1522
+
1523
+
**UPDATE** — compiles to `ALTER TABLE ... UPDATE` with mandatory WHERE:
1476
1524
1477
1525
```php
1478
1526
$result = (new Builder())
@@ -1484,6 +1532,31 @@ $result = (new Builder())
1484
1532
// ALTER TABLE `events` UPDATE `status` = ? WHERE `created_at` < ?
1485
1533
```
1486
1534
1535
+
**DELETE** — two forms. `delete()` defaults to the lightweight `DELETE FROM …` form, which marks rows deleted via a mask and is async by default. Opt into the heavier mutation form (`ALTER TABLE … DELETE`) when you need parts rewritten on disk; the two are not interchangeable, so the builder never auto-translates between them.
1536
+
1537
+
```php
1538
+
// Lightweight (default) — pair with `lightweight_deletes_sync = 0` for async
// ALTER TABLE `audit_log` DELETE WHERE `time` < ? SETTINGS mutations_sync=0
1556
+
```
1557
+
1558
+
The trailing `SETTINGS` clause is whatever the caller registers via `settings()` — the builder does not auto-pair a sync setting to a chosen delete mode.
1559
+
1487
1560
> **Note:** Full-text search (`Query::search()`) is not supported in ClickHouse and throws `UnsupportedException`. The ClickHouse builder also forces all join filter hook conditions to WHERE placement, since ClickHouse does not support subqueries in JOIN ON.
1488
1561
1489
1562
### MongoDB
@@ -1726,6 +1799,8 @@ Unsupported features are not on the class — consumers type-hint the interface
0 commit comments