I’m currently dealing with a large dataset comprising 10,000 rows from the Supabase DB. Clearly, it’s not practical to filter all this information in front-end with filters. Therefore, I’m looking to implement backend filtering.
The idea is that users can select filters, and based on their choices, the system will fetch the relevant data from the Supabase DB. However, I’ve encountered an issue where no variables are being displayed when attempting to create backend filters. I’m unsure if this is a bug or if I might be overlooking something in the process. Can you provide any insights or guidance on this matter?
When I try to bind it to my variable, it shows this error:
name: “Error”
code: “22P02”
details: “Token “X” is invalid.”
hint: null
message: “invalid input syntax for type json”
Everything works when I filter the exact way in front-end, instead of collection.
I have a feeling that the slash might be a problem. Could you try with somerhing without a slash (/) to actually confirm if this is the issue? I haven’t used these filters often honestly, so I’m just trying possible solutions.
This works for me actually. I assume that your database field ‘product’ is an array of texts? I have a field which is an array of texts and I’m using exactly the same method as you and it is working perfectly.
The error suggests this is a Supabase (PostgreSQL) error not WeWeb.
Supabase plugin filers items on back-end so double check your ‘products’ definition. The error suggests that PostgreSQL is receiving wrong datatype,
I even checked with 'X / Twitter" and it still works
I also had an issue in the past using the same stack.
I was using a JSON col in supabase but I had trouble using the arrays operators in the collection configuration in WeWeb.
I changed from a JSON type to an TEXT type to represent a real array and it works fine now.
It might be a trick and maybe the front should be updated to better operate on JSON.
BUT : HOPE guys. The new version of the supabase SDK is being implemented and should soon be available to us.
Yup, it helped to change to Text, instead of JSON in supabase side, but still having some problems.
“Ignore if empty” doesn’t work. @Matthieu did you also ran some problems with this? Building a directory with bunch of filters, that should fetch collections.