diff --git a/geocoder/available-services/README.md b/geocoder/available-services/README.md new file mode 100644 index 0000000..25dab7e --- /dev/null +++ b/geocoder/available-services/README.md @@ -0,0 +1,12 @@ +Available Services +=============== + +### Function + +Can be used to lookup available services by country name. Example, + +```sql +SELECT (admin0_available_services(Array['United States', 'ESP'])).* +``` + +The functions in sql/build_services_table.sql should be run after any postalcode update. \ No newline at end of file diff --git a/geocoder/available-services/sql/services.sql b/geocoder/available-services/sql/services.sql index f049ca4..b972dd3 100644 --- a/geocoder/available-services/sql/services.sql +++ b/geocoder/available-services/sql/services.sql @@ -1,6 +1,9 @@ --CREATE TYPE available_services_v1 AS (q TEXT, adm0_a3 TEXT, postal_code_points BOOLEAN, postal_code_polygons BOOLEAN); -CREATE OR REPLACE FUNCTION admin0_available_services(countries text[]) +--EXAMPLE +-- SELECT (admin0_available_services(Array['United States', 'ESP'])).* + +CREATE OR REPLACE FUNCTION admin0_available_services(name text[]) RETURNS SETOF available_services_v1 AS $$ DECLARE ret available_services_v1%rowtype;