Hey, I have a Supabase table that contains an arra...
# help
u
Hey, I have a Supabase table that contains an array of strings. I'm using supabase python. What's the best way to append/delete content from that array? I don't want to pull the array then modify it then push the updated array once again. Can we do this without pulling the whole array?
t
In my opinion If this is your requirement you should just create a new table with a 1 to many relationship that way you will be able to quickly concatenate the values to become a array at runtime and it will be quick to update / modify the array by deleting rows of the new table.
That said are you after
array_append
as per https://www.postgresql.org/docs/14/functions-array.html You can create a
rpc
and use these functions. Though I'm quite sure postgres is going to rewrite the whole field when you update using these functions and this is why a rethink of schema as per my first point is preferred.