Skip to content

bugfix: selecting-with-filter-on-empty-table - #22

Merged
spydon merged 4 commits into
supabase-community:mainfrom
jwelmac:bugfix/selecting-with-filter-on-empty-table
Sep 9, 2026
Merged

spydon merged 4 commits into
supabase-community:mainfrom
jwelmac:bugfix/selecting-with-filter-on-empty-table

Conversation

@jwelmac

@jwelmac jwelmac commented Mar 16, 2025

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix

Fixes #21

What is the current behavior?

See #21

What is the new behavior?

An empty array is returned if table is empty preventing error.

@jwelmac jwelmac changed the title Bugfix/selecting-with-filter-on-empty-table bugfix: selecting-with-filter-on-empty-table Mar 16, 2025
The referenced table branch dereferences returningRows.first the same
way the top level branch does, so filtering on a referenced table
column in an empty table still threw a Bad state error. Guarding at the
top of the loop covers both branches, as well as the case where an
earlier filter leaves no rows behind.
@spydon

spydon commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution, sorry for the long wait!
Once v3 is released the official supabase_test package will replace this one.

@spydon
spydon merged commit 440723b into supabase-community:main Sep 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: error thrown if row selected with filter in empty table

2 participants