Skip to content

Commit 05343c8

Browse files
lohanidamodarclaude
andcommitted
Add Utopia Query support replacing raw filter arrays
Replace all raw $filters array parameters with Utopia\Database\Query objects across the public API (queryEvents, sumEvents, countEvents, queryGauges, getGauge) and high-level helpers (getMetrics, getMetricsTotals, getBreakdown). The adapter now parses Query objects for filtering (equal, notEqual, greaterThan, lessThan, etc.), pagination (limit, offset), ordering (orderAsc, orderDesc), and virtual attributes (period, date) via a new parseQueries() helper. The ClickHouse adapter translates these into parameterized SQL via buildQueryFilters(). Added utopia-php/database as a dependency for the Query class. All 105 tests pass including new tests for Query-based filtering, pagination, and date ranges. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a33899d commit 05343c8

7 files changed

Lines changed: 2948 additions & 212 deletions

File tree

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"minimum-stability": "stable",
1818
"require": {
1919
"php": ">=8.3",
20-
"utopia-php/fetch": "0.5.*"
20+
"utopia-php/fetch": "0.5.*",
21+
"utopia-php/database": "^5.3"
2122
},
2223
"require-dev": {
2324
"phpunit/phpunit": "^9.5",

0 commit comments

Comments
 (0)