Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/swift-ivm-aggregates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'zero-swift': minor
---

Queries can compute aggregates, `distinct()` and `groupBy()` on the client, with the IVM operators of the JS client (`Aggregate`, `GroupBy`, `GroupProjection` and `LiftField`), kept up to date as rows change. The untyped builder has `count()`, `sum`, `avg`, `min` and `max` (of a column, or of a value at a JSON path: `sum(json: "metadata", "points")`), `distinct(...)`, and `groupBy(...)` followed by an aggregate, with the JS builder's checks. On a query the view holds the value; in `related(...)` the relationship does, for a junction relationship too. `min` or `max` of values JS can't compare, such as a json column without a path, fails the query with JS's error.

Breaking: `ViewValue` has a new case, `.value`, an aggregate's value; an exhaustive `switch` over it needs one too.
2 changes: 1 addition & 1 deletion .github/workflows/public-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ on:
workflow_dispatch:
push:
branches: [main]
# Any base, so a PR stacked on another one gets checked too.
pull_request:
branches: [main]

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/swift-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
- 'packages/zero-conformance/**'
- 'apps/zbugs-swift/**'
- '.github/workflows/swift-macos.yml'
# Any base, so a PR stacked on another one gets checked too.
pull_request:
branches: [main]
paths:
- 'swift/**'
- 'packages/zero-conformance/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
push:
# swift-client is the development branch until the client lands on main.
branches: [main, swift-client]
# Any base, so a PR stacked on another one gets checked too.
pull_request:
branches: [main]

concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zbugs-screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ on:
- 'swift/Sources/ZeroTesting/**'
- 'swift/TestHost/**'
- '.github/workflows/zbugs-screenshots.yml'
# Any base, so a PR stacked on another one gets checked too.
pull_request:
branches: [main]
paths:
- 'apps/zbugs-swift/**'
- 'swift/Sources/ZeroUI/**'
Expand Down
Loading
Loading