Closed whoiscarlo closed 7 months ago
Hey, thanks for contribution 👋 Supabase uses PostgREST underneath to expose postgres as an API. What we have in the client code is written according to that. Here is the related documentation about it. https://postgrest.org/en/stable/references/api/tables_views.html#horizontal-filtering
To be honest PostgREST documentation doesn't clarify the question "How the arrays should be represented?". So it would be great if you test the expected behaviour and edge cases and link to the PR.
(Also I will be trying it as well 🙂 )
Hey, first of all, thank you, I have created a new local setup and cases for this pr and will test it completely fine. I will get back to your additions
I tested the usecase and it works with your PR!
What kind of change does this PR introduce?
Correctly formatting the array used by the Contains & ContainedBy functions
Bug fix, feature, docs update, ... Arrays in Postgres use this string format
{10000, 10000, 10000, 10000}
or{"meeting", "lunch"}
What is the current behavior?
value
[]string{"foo", "bar"}
turns intofoo bar
Please link any relevant issues here. https://github.com/supabase-community/postgrest-go/pull/43
What is the new behavior?
Will turn values
[]string{"foo", "bar"} into '{"foo", "bar"}
Additional context
https://www.postgresql.org/docs/current/arrays.html