The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
update sql in postgis ionic article to return table instead of setof records
dshukertjr1b0d3087fd36
diff --git a/apps/www/_blog/2023-03-01-geo-queries-with-postgis-in-ionic-angular.mdx b/apps/www/_blog/2023-03-01-geo-queries-with-postgis-in-ionic-angular.mdxindex bfd211a9964..76137060030 100644--- a/apps/www/_blog/2023-03-01-geo-queries-with-postgis-in-ionic-angular.mdx+++ b/apps/www/_blog/2023-03-01-geo-queries-with-postgis-in-ionic-angular.mdx@@ -127,10 +127,10 @@ Those are some powerful calculations, and we can easily use them through the Pos```sql-- create database function to find nearby storescreate or replace function nearby_stores(lat float, long float)-returns setof record+returns table (id public.stores.id%TYPE, name public.stores.name%TYPE, description public.stores.description%TYPE, lat float, long float, dist_meters float)language sqlas $$- select id, name, description, st_astext(location) as location, st_distance(location, st_point(long, lat)::geography) as dist_meters+ select id, name, description, st_y(location::geometry) as lat, st_x(location::geometry) as long, st_distance(location, st_point(long, lat)::geography) as dist_metersfrom public.storesorder by location <-> st_point(long, lat)::geography;$$;@@ -138,10 +138,10 @@ $$;-- create database function to find stores in a specific boxcreate or replace function stores_in_view(min_lat float, min_long float, max_lat float, max_long float)-returns setof record+returns table (id public.stores.id%TYPE, name public.stores.name%TYPE, lat float, long float)language sqlas $$- select id, name, ST_Y(location::geometry) as lat, ST_X(location::geometry) as long, st_astext(location) as location+ select id, name, ST_Y(location::geometry) as lat, ST_X(location::geometry) as longfrom public.storeswhere location && ST_SetSRID(ST_MakeBox2D(ST_Point(min_long, min_lat), ST_Point(max_long, max_lat)),4326)$$;