Category: Supabase and databases

Supabase: UPDATE ends without error, but does not change anything

Read this guide in Polish

Calling update().eq() returns an empty result, although the record exists in the database. RLS policy for UPDATE may not allow updated line; SELECT visibility and WITH CHECK condition of new values are also important.

How to determine the source of the error

Compare eq filters and column values, then check the role of JWT and policy for UPDATE and SELECT.

See if you can modify a column that stops meeting WITH CHECK after changing.

What to do step by step

1. Match USING conditions separately for changeable rows and WITH CHECK for update result.

2 . Ask for data return or the number of changed lines and handle case zero instead of assuming success.

How to check the score

Updating your own record works, and trying to change another person's record still does not pass.

What to do

Do not treat HTTP 204 as evidence of a change in a specific record.