Open kinolaev opened 2 months ago
To give a similar example with our tests:
curl -X PATCH 'localhost:3000/entities?select=id,name&or=(name.is.null,name.like.*test*)' \
-H 'Content-Type: application/json' \
-H 'Prefer: return=representation' \
-d '{"name": "New name"}'
Got:
[]
Expected:
[{"id":4,"name":"New name"}]
Environment
Description of issue
I faced a problem when trying to update a timestamp column and return the updated value.
Here is the table structure:
I want to update and return a job if it has not been started yet or if it was started more then one minute ago.
But when I make the following query using supabase:
PostgREST generates a query that doesn't returns the updated row:
The problem is the last WHERE clause because at this stage
started_at
has already been set tonow()
which can't be less then a moment in the past.Furthermore, if you try to remove
started_at
from select:you'll recieve an error because the following query is invalid:
Notice the
pgrst_source
here, it contains onlyid
but the WHERE clause still referencesstarted_at
.Looks like the problem is related to the
or
operator because when I useis.null
:or
lt.
separately:there is no WHERE clause in the generated by PostgREST query:
This is expected behavior and
or
operator should not add WHERE clause as I understand.