• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-flutter / 39618919877
92%

Build:
DEFAULT BRANCH: main
Ran 21 Oct 2026 02:42PM UTC
Jobs 11
Files 171
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Oct 2026 02:40PM UTC coverage: 91.847%. Remained the same
39618919877

push

github

web-flow
feat(postgrest): count the rows of a to-many relation without aggregates (#2005)

## Summary

`PostgrestDerivedExpression.countAll()` and the column aggregates need
PostgREST's `db-aggregates-enabled`, which is off by default, so
counting related rows on the typed API failed on a default project.
PostgREST accepts an embed of `count` without that setting, and this
adds a typed way to send it.

`PostgrestToManyRelation.count()` returns a `PostgrestEmbeddedCount`
that:

* renders `"messages(count)":messages(count)`, under an alias of its own
so it never merges with other entries of the relation
(`messages(id),"messages(count)":messages(count)` is accepted and
returns both)
* keys an aliased relation by the alias,
`"child_orders(count)":orders!orders_parent_id_fkey(count)`
* reads as `int` straight from the `PostgrestPartialRow`

```dart
final channels = await client
    .table(Channels.table)
    .selectOnly([Channels.id, Channels.messages.count()]);
final int messageCount = channels.first.read(Channels.messages.count());
```

It is only on to-many relations, since a to-one embed has at most one
row.

## Testing

* Unit tests for rendering, aliasing, nesting and reading.
* An integration test against the local stack (aggregates disabled) that
counts messages per user alongside a column embed of the same relation,
including zero counts.

Resolves SDK-2312

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

- **New Features**
- Added support for counting rows in embedded to-many relations without
selecting aggregate data.
- Relation counts can be aliased, nested within parent embeds, selected
alongside other relation fields, and decoded as integers.
- Counts accurately report zero for empty relations while preserving
embedded row data.

- **Documentation**
- Clarified that relation counts include embedded rows without
aggregates.

<!-- end of auto-generated comment: re... (continued)

18 of 19 new or added lines in 3 files covered. (94.74%)

24 existing lines in 3 files now uncovered.

10623 of 11566 relevant lines covered (91.85%)

5.37 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
92.68
0.0% packages/postgrest/lib/src/postgrest_embedded_relation.dart

Coverage Regressions

Lines Coverage ∆ File
12
80.65
0.0% packages/postgrest/lib/src/postgrest_derived_expression.dart
8
89.13
0.0% packages/postgrest/lib/src/postgrest_typed_builder.dart
4
92.68
0.0% packages/postgrest/lib/src/postgrest_embedded_relation.dart
Jobs
ID Job ID Ran Files Coverage
8 iceberg - 39618919877.8 21 Oct 2026 02:42PM UTC 6
71.32
GitHub Action Run
9 supabase_typegen - 39618919877.9 21 Oct 2026 02:42PM UTC 6
94.36
GitHub Action Run
10 supabase_flutter - 39618919877.10 21 Oct 2026 02:42PM UTC 16
80.85
GitHub Action Run
11 supabase_functions - 39618919877.11 21 Oct 2026 02:42PM UTC 4
93.28
GitHub Action Run
6 supabase - 39617754454.6 21 Oct 2026 02:37PM UTC 17
93.96
GitHub Action Run
11 supabase_common - 39605471296.11 21 Oct 2026 01:10PM UTC 35
93.58
GitHub Action Run
11 supabase_auth - 39617754454.11 21 Oct 2026 02:38PM UTC 34
93.38
GitHub Action Run
10 postgrest - 39617754454.10 21 Oct 2026 02:36PM UTC 28
92.4
GitHub Action Run
9 yet_another_json_isolate - 39603824352.9 21 Oct 2026 12:58PM UTC 1
98.44
GitHub Action Run
8 supabase_storage - 39617754454.8 21 Oct 2026 02:36PM UTC 10
96.26
GitHub Action Run
9 supabase_realtime - 39617754454.9 21 Oct 2026 02:36PM UTC 14
91.17
GitHub Action Run
Source Files on build 39618919877
  • Tree
  • List 171
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #39618919877
  • 511cfb57 on github
  • Prev Build on main (#39617754454)
  • Next Build on main (#39619309191)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc