Alvin
08/18/2021, 12:22 PMKosh
08/18/2021, 12:24 PMKosh
08/18/2021, 12:25 PMST_Distance(myTable.savedLocation, ST_GeogFromText(my_location))
this will return u a distance between two locations, u can also use it to order by ur query šKosh
08/18/2021, 12:27 PM$$;
CREATE
OR REPLACE FUNCTION public.select_nearby_feed(my_location text) RETURNS SETOF feed LANGUAGE sql AS $$
select * from feed
ORDER BY ST_Distance(feed.location, ST_GeogFromText(my_location)), created_at DESC;
$$;
and from flutter.
_supabase.client.rpc('select_nearby_feed', params: {'my_location', 'POINT(longitude latitude)'})
.execute();
Kosh
08/18/2021, 12:28 PMbdlukaa
08/18/2021, 12:56 PMTyler
08/19/2021, 12:06 PMburggraf
08/28/2021, 5:41 PM