-
-
Notifications
You must be signed in to change notification settings - Fork 1
Buildings
Josef Gabrielsson edited this page Jul 8, 2021
·
11 revisions
URL: https://gqfktgknxmguhxgkajat.supabase.co
Key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYyMDc2MTg0NCwiZXhwIjoxOTM2MzM3ODQ0fQ.xEa_GuNypFdHSdQVLCd0beoL_v8jhWKjSTypX6kn-sg
create policy "Public buildings are viewable by everyone." on buildings for select using (true);
https://gqfktgknxmguhxgkajat.supabase.co/rest/v1/buildings
https://gqfktgknxmguhxgkajat.supabase.co/rest/v1/rpc/buildings
- Churches
- Schools
CREATE OR REPLACE FUNCTION buildings()
RETURNS TABLE(church bigint, dead bigint) AS $$
BEGIN
RETURN QUERY
SELECT
SUM(1) FILTER (WHERE church IS NOT NULL) AS churches,
SUM(1) FILTER (WHERE school IS NOT NULL) AS schools
FROM buildings;
END
$$ LANGUAGE plpgsql;
Persons