-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query params sent when values are undefined #441
Comments
There may be a bigger problem with the library but just so you're aware, the supabase-js client will default to setting values to null when passing an array to upsert. Which can be fixed by setting https://supabase.com/docs/reference/javascript/upsert
I dont think this library exposes that capability unfortunately. For example this is how you do it using the js client directly:
I dealt with this last week using the js client directly so just wanted to share since it was fresh on my mind and might help with updating the library here :) |
oh wait yes you can, that property is exposed in the fourth parameter
Does something like that work? Also where is |
i copy pasted some custom code so that how the
this works nice 👍👍 so something did change in supabase for this to be mandatory now 🤔 |
great! glad that worked. Not quite sure, I started working with Supabase JS in January of this year and its been around since then 🤷 |
Describe the bug
In the hook
useUpsertMutation
when we pass in the payload with an object with values undefined the columns are sent to supabase.Note:
This was working before fine. Its recently that this broke.
To Reproduce
Let me give you my use case.
Given the below schema
Notice how the id is autogenerated so it is not mandatory to be sent along in the payload.
So,
When we send
This fails with error
"null value in column \"id\" of relation \"NotificationLog\" violates not-null constraint"
Upon inspection of the network request i noticed that the column
id
is sent even though in the payload it is undefined.Im not sure why its failing suddenly out of the blue. Maybe something changed in supabase ? I'm not sure if its a bug here and am a little concerned of my usage of this mutation. Please advice
The text was updated successfully, but these errors were encountered: