I’d like to create a Supabase/postgres query from webweb:
SELECT name, latitude, longitude, ST_Distance(c.geom, ref.geom) AS distance
FROM cities c,
(SELECT geom FROM cities WHERE id = 12) AS ref
ORDER BY c.geom ↔ ref.geom
LIMIT 50;
How can this be setup deom the weweb data tab?
Hello, I don’t think this can be done via the WeWeb’s Supabase Plugin, what you should do is a function, or a view, but since I see you’re using dynamic parameters, you might want to go for a Stored Procedure directly (a function). You can then call it from WeWeb by using the Invoke Postgres Function workflow action and save the results in a variable, or do whatever you need with it.
1 Like
Hey Roberto, thanks for the suggestion. It put me on the right track and it seems like you can more simply just have the sql query as is in the sql data placeholder and just bind the right id based on other queries.
1 Like