Added server specification API tests

This commit is contained in:
Mario de Frutos
2015-11-23 11:48:24 +01:00
parent d2a096907e
commit 6722f64f23
18 changed files with 478 additions and 67 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
-- Interfacess of the server extension
---- geocode_admin1_polygon(admin1_name text)
CREATE OR REPLACE FUNCTION geocode_admin1_polygon(user_id name, tx_id bigint, admin1_name text)
CREATE OR REPLACE FUNCTION geocode_admin1_polygon(user_id name, user_config json, geocoder_config json, admin1_name text)
RETURNS Geometry AS $$
plpy.debug('Entering geocode_admin1_polygon(admin1_name text)')
plpy.debug('user_id = %s' % user_id)
@@ -23,7 +23,7 @@ RETURNS Geometry AS $$
$$ LANGUAGE plpythonu;
---- geocode_admin1_polygon(admin1_name text, country_name text)
CREATE OR REPLACE FUNCTION geocode_admin1_polygon(user_id name, tx_id bigint, admin1_name text, country_name text)
CREATE OR REPLACE FUNCTION geocode_admin1_polygon(user_id name, user_config json, geocoder_config json, admin1_name text, country_name text)
RETURNS Geometry AS $$
plpy.debug('Entering geocode_admin1_polygon(admin1_name text, country_name text)')
plpy.debug('user_id = %s' % user_id)
@@ -1,7 +1,7 @@
-- Interfacess of the server extension
---- geocode_namedplace_point(city_name text)
CREATE OR REPLACE FUNCTION geocode_namedplace_point(user_id name, tx_id bigint, city_name text)
CREATE OR REPLACE FUNCTION geocode_namedplace_point(user_id name, user_config json, geocoder_config json, city_name text)
RETURNS Geometry AS $$
plpy.debug('Entering geocode_namedplace_point(city_name text)')
plpy.debug('user_id = %s' % user_id)
@@ -23,7 +23,7 @@ RETURNS Geometry AS $$
$$ LANGUAGE plpythonu;
---- geocode_namedplace_point(city_name text, country_name text)
CREATE OR REPLACE FUNCTION geocode_namedplace_point(user_id name, tx_id bigint, city_name text, country_name text)
CREATE OR REPLACE FUNCTION geocode_namedplace_point(user_id name, user_config json, geocoder_config json, city_name text, country_name text)
RETURNS Geometry AS $$
plpy.debug('Entering geocode_namedplace_point(city_name text, country_name text)')
plpy.debug('user_id = %s' % user_id)
@@ -45,7 +45,7 @@ RETURNS Geometry AS $$
$$ LANGUAGE plpythonu;
---- geocode_namedplace_point(city_name text, admin1_name text, country_name text)
CREATE OR REPLACE FUNCTION geocode_namedplace_point(user_id name, tx_id bigint, city_name text, admin1_name text, country_name text)
CREATE OR REPLACE FUNCTION geocode_namedplace_point(user_id name, user_config json, geocoder_config json, city_name text, admin1_name text, country_name text)
RETURNS Geometry AS $$
plpy.debug('Entering geocode_namedplace_point(city_name text, admin1_name text, country_name text)')
plpy.debug('user_id = %s' % user_id)
@@ -2,7 +2,7 @@
-- Interface of the server extension
CREATE OR REPLACE FUNCTION geocode_postalcode_point(user_id NAME, tx_id BIGINT, code text)
CREATE OR REPLACE FUNCTION geocode_postalcode_point(user_id name, user_config json, geocoder_config json, code text)
RETURNS Geometry AS $$
plpy.debug('Entering _geocode_postalcode_point')
plpy.debug('user_id = %s' % user_id)
@@ -23,7 +23,7 @@ RETURNS Geometry AS $$
return rv[0]["point"]
$$ LANGUAGE plpythonu;
CREATE OR REPLACE FUNCTION geocode_postalcode_point(user_id NAME, tx_id BIGINT, code text, country text)
CREATE OR REPLACE FUNCTION geocode_postalcode_point(user_id name, user_config json, geocoder_config json, code text, country text)
RETURNS Geometry AS $$
plpy.debug('Entering _geocode_postalcode_point')
plpy.debug('user_id = %s' % user_id)
@@ -44,7 +44,7 @@ RETURNS Geometry AS $$
return rv[0]["point"]
$$ LANGUAGE plpythonu;
CREATE OR REPLACE FUNCTION geocode_postalcode_polygon(user_id NAME, tx_id BIGINT, code text)
CREATE OR REPLACE FUNCTION geocode_postalcode_polygon(user_id name, user_config json, geocoder_config json, code text)
RETURNS Geometry AS $$
plpy.debug('Entering _geocode_postalcode_polygon')
plpy.debug('user_id = %s' % user_id)
@@ -65,7 +65,7 @@ RETURNS Geometry AS $$
return rv[0]["polygon"]
$$ LANGUAGE plpythonu;
CREATE OR REPLACE FUNCTION geocode_postalcode_polygon(user_id NAME, tx_id BIGINT, code text, country text)
CREATE OR REPLACE FUNCTION geocode_postalcode_polygon(user_id name, user_config json, geocoder_config json, code text, country text)
RETURNS Geometry AS $$
plpy.debug('Entering _geocode_postalcode_point')
plpy.debug('user_id = %s' % user_id)
+2 -2
View File
@@ -1,6 +1,6 @@
-- Interface of the server extension
CREATE OR REPLACE FUNCTION geocode_ip_point(user_id NAME, tx_id BIGINT, ip TEXT)
CREATE OR REPLACE FUNCTION geocode_ip_point(user_id name, user_config json, geocoder_config json, ip text)
RETURNS Geometry AS $$
plpy.debug('Entering _geocode_ip_point')
plpy.debug('user_id = %s' % user_id)
@@ -26,7 +26,7 @@ $$ LANGUAGE plpythonu;
-- Implementation of the server extension
-- Note: these functions depend on the cdb_geocoder extension
CREATE OR REPLACE FUNCTION _geocode_ip_point(ip TEXT)
CREATE OR REPLACE FUNCTION _geocode_ip_point(ip text)
RETURNS Geometry AS $$
DECLARE
ret Geometry;