I have the following sql query in the sql plugin in one of the data collections:
SELECT id, name, slug, emoji, iso, population
FROM countries
ORDER BY population DESC;
When I run this in my db it generates results correctly (China on top).
In the SQL plugin it sorts by name. I also tried the sql query without the order and choose it in the sort menu below. In this case the result is a different order but still not order by population desc (like in the screenshot).
I’ve also refreshed and resynced the data a few times, tried to do SELECT *, and made sure that population is an int8 column that one can sort by.
Because you cannot do static collections with Supabase’s plugin, only with SQL.
I’ve tried with and without UI sorting in the plugin. This is just a screenshot where both sortings were applied. Tried with either other as well (in query and in UI)
FYI the SQL plugin is not secure and it’s not meant to be used in an app exposed to the public internet. I would add that even with an app in a private network it shouldn’t be used with user-generated data.
For reference see the docs
As Mariano said, it’s quite dangerous if exposed - and abused. If you want to have Static collections, you can call Supabase via the REST endpoints that each Supa project has and use the REST Plugin in WeWeb to get Static Collections. As REST lets you have them. Then everything should work.
Supabase by default creates a REST API layer around your project (tables, functions etc.), you can write a stored procedure/view in Supa and call it via REST to get the data, it’s really as simple as that.