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

supabase / supabase-flutter / 36568174948
94%

Build:
DEFAULT BRANCH: main
Ran 29 Sep 2026 12:30PM 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

29 Sep 2026 12:26PM UTC coverage: 91.223% (-0.003%) from 91.226%
36568174948

push

github

web-flow
fix(typegen): keep the document order of foreign keys when partitioning relationships (#1894)

## What

`_foreignKeysByColumn` partitions the relationships into "references a
table" and "references a view" with two `where` passes instead of
`List.sort`, so the relative order inside each half is the document
order.

## Why

The partition used `..sort()` with a comparator that returns `0` for
every pair in the same half. `List.sort` is not stable: it is an
insertion sort for up to 33 elements (`right - left <= 32` in
`dart:_internal`) and a dual-pivot quicksort from 34, which reorders
equal elements. The map is then filled with `putIfAbsent`, so when a
column carries more than one foreign key (an overlapping composite key
next to a single-column one, for example) the winner is "whichever one
the quicksort put first" once the schema has 34 or more relationships,
and it can flip when an unrelated relationship is added elsewhere.

`sortGeneratorMetadata` (#1883, mirroring supabase/sdk#207) puts the
relationships in a deterministic order precisely so that the generated
code is stable, and the parser's contract comment says document order is
kept. This is the one step that could still reorder them.

Concrete case, pinned by the test: `books.author_id` has
`books_author_id_fkey` to `authors` first in the document and
`books_author_id_editors_fkey` to `editors` at position 30, with 32
other relationships around them.

| Relationships in the document | `main` | this PR |
|---|---|---|
| up to 33 | `authors` | `authors` |
| 34 | `editors` | `authors` |

## Not a breaking change

No public API changes. For documents whose columns each carry a single
foreign key, or with 33 or fewer relationships, the output is identical.

## Tests

`packages/supabase_typegen/test/generator_metadata_parser_test.dart`:
`the first foreign key on a column wins past the sort threshold`, built
from 34 inline relationships. Fails on `main` (`Expected: 'authors'
Actual: 'editors'`) and p... (continued)

9 of 9 new or added lines in 1 file covered. (100.0%)

8793 of 9639 relevant lines covered (91.22%)

4.95 hits per line

Jobs
ID Job ID Ran Files Coverage
11 supabase_typegen - 36568174948.11 29 Sep 2026 12:30PM UTC 24
95.57
GitHub Action Run
7 supabase_storage - 36537528666.7 29 Sep 2026 07:39AM UTC 9
97.83
GitHub Action Run
4 supabase_realtime - 36537528666.4 29 Sep 2026 07:39AM UTC 13
90.66
GitHub Action Run
2 yet_another_json_isolate - 35608843571.2 21 Sep 2026 01:58PM UTC 1
98.44
GitHub Action Run
8 supabase_common - 35998092270.8 24 Sep 2026 12:18PM UTC 22
87.5
GitHub Action Run
5 iceberg - 36537528666.5 29 Sep 2026 07:36AM UTC 6
68.52
GitHub Action Run
10 supabase_auth - 36537528666.10 29 Sep 2026 07:43AM UTC 32
92.06
GitHub Action Run
9 supabase_functions - 36537528666.9 29 Sep 2026 07:36AM UTC 4
96.0
GitHub Action Run
8 postgrest - 36537528666.8 29 Sep 2026 07:39AM UTC 28
94.17
GitHub Action Run
3 supabase - 36537528666.3 29 Sep 2026 07:40AM UTC 18
93.71
GitHub Action Run
6 supabase_flutter - 36537528666.6 29 Sep 2026 07:37AM UTC 14
78.5
GitHub Action Run
Source Files on build 36568174948
  • Tree
  • List 171
  • Changed 6
  • Source Changed 6
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #36568174948
  • e1f4a83b on github
  • Prev Build on main (#36549440608)
  • Next Build on main (#36606520173)
  • 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