Bump versions
This commit is contained in:
parent
34fc6439d2
commit
f3f2b213e7
@ -63,12 +63,6 @@ CREATE TYPE cdb_dataservices_client.isoline AS (
|
|||||||
the_geom geometry(Multipolygon,4326)
|
the_geom geometry(Multipolygon,4326)
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TYPE cdb_dataservices_client.geocoding AS (
|
|
||||||
cartodb_id integer,
|
|
||||||
the_geom geometry(Multipolygon,4326),
|
|
||||||
metadata jsonb
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE TYPE cdb_dataservices_client.simple_route AS (
|
CREATE TYPE cdb_dataservices_client.simple_route AS (
|
||||||
shape geometry(LineString,4326),
|
shape geometry(LineString,4326),
|
||||||
length real,
|
length real,
|
||||||
@ -406,31 +400,6 @@ $$ LANGUAGE 'plpgsql' SECURITY DEFINER STABLE PARALLEL UNSAFE;
|
|||||||
-- These are the only ones with permissions to publicuser role
|
-- These are the only ones with permissions to publicuser role
|
||||||
-- and should also be the only ones with SECURITY DEFINER
|
-- and should also be the only ones with SECURITY DEFINER
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION cdb_dataservices_client.cdb_bulk_geocode_street_point (searchtext jsonb)
|
|
||||||
RETURNS SETOF cdb_dataservices_client.geocoding AS $$
|
|
||||||
DECLARE
|
|
||||||
|
|
||||||
username text;
|
|
||||||
orgname text;
|
|
||||||
BEGIN
|
|
||||||
IF session_user = 'publicuser' OR session_user ~ 'cartodb_publicuser_*' THEN
|
|
||||||
RAISE EXCEPTION 'The api_key must be provided';
|
|
||||||
END IF;
|
|
||||||
SELECT u, o INTO username, orgname FROM cdb_dataservices_client._cdb_entity_config() AS (u text, o text);
|
|
||||||
-- JSON value stored "" is taken as literal
|
|
||||||
IF username IS NULL OR username = '' OR username = '""' THEN
|
|
||||||
RAISE EXCEPTION 'Username is a mandatory argument, check it out';
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
RETURN QUERY SELECT * FROM cdb_dataservices_client._cdb_bulk_geocode_street_point(username, orgname, searchtext);
|
|
||||||
END;
|
|
||||||
$$ LANGUAGE 'plpgsql' SECURITY DEFINER STABLE PARALLEL UNSAFE;
|
|
||||||
--
|
|
||||||
-- Public dataservices API function
|
|
||||||
--
|
|
||||||
-- These are the only ones with permissions to publicuser role
|
|
||||||
-- and should also be the only ones with SECURITY DEFINER
|
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION cdb_dataservices_client.cdb_here_geocode_street_point (searchtext text ,city text DEFAULT NULL ,state_province text DEFAULT NULL ,country text DEFAULT NULL)
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client.cdb_here_geocode_street_point (searchtext text ,city text DEFAULT NULL ,state_province text DEFAULT NULL ,country text DEFAULT NULL)
|
||||||
RETURNS Geometry AS $$
|
RETURNS Geometry AS $$
|
||||||
DECLARE
|
DECLARE
|
||||||
@ -2408,42 +2377,6 @@ $$ LANGUAGE 'plpgsql' SECURITY DEFINER STABLE PARALLEL UNSAFE;
|
|||||||
-- Exception-safe private DataServices API function
|
-- Exception-safe private DataServices API function
|
||||||
--
|
--
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_bulk_geocode_street_point_exception_safe (searchtext jsonb)
|
|
||||||
RETURNS SETOF cdb_dataservices_client.geocoding AS $$
|
|
||||||
DECLARE
|
|
||||||
|
|
||||||
username text;
|
|
||||||
orgname text;
|
|
||||||
_returned_sqlstate TEXT;
|
|
||||||
_message_text TEXT;
|
|
||||||
_pg_exception_context TEXT;
|
|
||||||
BEGIN
|
|
||||||
IF session_user = 'publicuser' OR session_user ~ 'cartodb_publicuser_*' THEN
|
|
||||||
RAISE EXCEPTION 'The api_key must be provided';
|
|
||||||
END IF;
|
|
||||||
SELECT u, o INTO username, orgname FROM cdb_dataservices_client._cdb_entity_config() AS (u text, o text);
|
|
||||||
-- JSON value stored "" is taken as literal
|
|
||||||
IF username IS NULL OR username = '' OR username = '""' THEN
|
|
||||||
RAISE EXCEPTION 'Username is a mandatory argument, check it out';
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
|
|
||||||
BEGIN
|
|
||||||
RETURN QUERY SELECT * FROM cdb_dataservices_client._cdb_bulk_geocode_street_point(username, orgname, searchtext);
|
|
||||||
EXCEPTION
|
|
||||||
WHEN OTHERS THEN
|
|
||||||
GET STACKED DIAGNOSTICS _returned_sqlstate = RETURNED_SQLSTATE,
|
|
||||||
_message_text = MESSAGE_TEXT,
|
|
||||||
_pg_exception_context = PG_EXCEPTION_CONTEXT;
|
|
||||||
RAISE WARNING USING ERRCODE = _returned_sqlstate, MESSAGE = _message_text, DETAIL = _pg_exception_context;
|
|
||||||
|
|
||||||
END;
|
|
||||||
END;
|
|
||||||
$$ LANGUAGE 'plpgsql' SECURITY DEFINER STABLE PARALLEL UNSAFE;
|
|
||||||
--
|
|
||||||
-- Exception-safe private DataServices API function
|
|
||||||
--
|
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_here_geocode_street_point_exception_safe (searchtext text ,city text DEFAULT NULL ,state_province text DEFAULT NULL ,country text DEFAULT NULL)
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_here_geocode_street_point_exception_safe (searchtext text ,city text DEFAULT NULL ,state_province text DEFAULT NULL ,country text DEFAULT NULL)
|
||||||
RETURNS Geometry AS $$
|
RETURNS Geometry AS $$
|
||||||
DECLARE
|
DECLARE
|
||||||
@ -4368,14 +4301,6 @@ RETURNS Geometry AS $$
|
|||||||
|
|
||||||
SELECT cdb_dataservices_server.cdb_geocode_street_point (username, orgname, searchtext, city, state_province, country);
|
SELECT cdb_dataservices_server.cdb_geocode_street_point (username, orgname, searchtext, city, state_province, country);
|
||||||
|
|
||||||
$$ LANGUAGE plproxy VOLATILE PARALLEL UNSAFE;
|
|
||||||
DROP FUNCTION IF EXISTS cdb_dataservices_client._cdb_bulk_geocode_street_point (username text, orgname text, searchtext jsonb);
|
|
||||||
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_bulk_geocode_street_point (username text, orgname text, searchtext jsonb)
|
|
||||||
RETURNS SETOF cdb_dataservices_client.geocoding AS $$
|
|
||||||
CONNECT cdb_dataservices_client._server_conn_str();
|
|
||||||
|
|
||||||
SELECT * FROM cdb_dataservices_server.cdb_bulk_geocode_street_point (username, orgname, searchtext);
|
|
||||||
|
|
||||||
$$ LANGUAGE plproxy VOLATILE PARALLEL UNSAFE;
|
$$ LANGUAGE plproxy VOLATILE PARALLEL UNSAFE;
|
||||||
DROP FUNCTION IF EXISTS cdb_dataservices_client._cdb_here_geocode_street_point (username text, orgname text, searchtext text, city text, state_province text, country text);
|
DROP FUNCTION IF EXISTS cdb_dataservices_client._cdb_here_geocode_street_point (username text, orgname text, searchtext text, city text, state_province text, country text);
|
||||||
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_here_geocode_street_point (username text, orgname text, searchtext text, city text DEFAULT NULL, state_province text DEFAULT NULL, country text DEFAULT NULL)
|
CREATE OR REPLACE FUNCTION cdb_dataservices_client._cdb_here_geocode_street_point (username text, orgname text, searchtext text, city text DEFAULT NULL, state_province text DEFAULT NULL, country text DEFAULT NULL)
|
||||||
@ -4884,9 +4809,6 @@ GRANT EXECUTE ON FUNCTION cdb_dataservices_client._cdb_geocode_ipaddress_point_e
|
|||||||
GRANT EXECUTE ON FUNCTION cdb_dataservices_client.cdb_geocode_street_point(searchtext text, city text, state_province text, country text) TO publicuser;
|
GRANT EXECUTE ON FUNCTION cdb_dataservices_client.cdb_geocode_street_point(searchtext text, city text, state_province text, country text) TO publicuser;
|
||||||
GRANT EXECUTE ON FUNCTION cdb_dataservices_client._cdb_geocode_street_point_exception_safe(searchtext text, city text, state_province text, country text ) TO publicuser;
|
GRANT EXECUTE ON FUNCTION cdb_dataservices_client._cdb_geocode_street_point_exception_safe(searchtext text, city text, state_province text, country text ) TO publicuser;
|
||||||
|
|
||||||
GRANT EXECUTE ON FUNCTION cdb_dataservices_client.cdb_bulk_geocode_street_point(searchtext jsonb) TO publicuser;
|
|
||||||
GRANT EXECUTE ON FUNCTION cdb_dataservices_client._cdb_bulk_geocode_street_point_exception_safe(searchtext jsonb ) TO publicuser;
|
|
||||||
|
|
||||||
GRANT EXECUTE ON FUNCTION cdb_dataservices_client.cdb_here_geocode_street_point(searchtext text, city text, state_province text, country text) TO publicuser;
|
GRANT EXECUTE ON FUNCTION cdb_dataservices_client.cdb_here_geocode_street_point(searchtext text, city text, state_province text, country text) TO publicuser;
|
||||||
GRANT EXECUTE ON FUNCTION cdb_dataservices_client._cdb_here_geocode_street_point_exception_safe(searchtext text, city text, state_province text, country text ) TO publicuser;
|
GRANT EXECUTE ON FUNCTION cdb_dataservices_client._cdb_here_geocode_street_point_exception_safe(searchtext text, city text, state_province text, country text ) TO publicuser;
|
||||||
|
|
||||||
|
5038
client/cdb_dataservices_client--0.25.0.sql
Normal file
5038
client/cdb_dataservices_client--0.25.0.sql
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
comment = 'CartoDB dataservices client API extension'
|
comment = 'CartoDB dataservices client API extension'
|
||||||
default_version = '0.24.0'
|
default_version = '0.25.0'
|
||||||
requires = 'plproxy, cartodb'
|
requires = 'plproxy, cartodb'
|
||||||
superuser = true
|
superuser = true
|
||||||
schema = cdb_dataservices_client
|
schema = cdb_dataservices_client
|
||||||
|
@ -2341,13 +2341,6 @@ RETURNS VOID AS $$
|
|||||||
config = RateLimitsConfig(service=service, username=username, limit=limit, period=period)
|
config = RateLimitsConfig(service=service, username=username, limit=limit, period=period)
|
||||||
config_setter.set_server_rate_limits(config)
|
config_setter.set_server_rate_limits(config)
|
||||||
$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE;
|
$$ LANGUAGE plpythonu VOLATILE PARALLEL UNSAFE;
|
||||||
-- TODO: could cartodb_id be replaced by rowid, maybe needing extra care for offset?
|
|
||||||
CREATE TYPE cdb_dataservices_server.geocoding AS (
|
|
||||||
cartodb_id integer,
|
|
||||||
the_geom geometry(Multipolygon,4326),
|
|
||||||
metadata jsonb
|
|
||||||
);
|
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text)
|
CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_admin0_polygon(username text, orgname text, country_name text)
|
||||||
RETURNS Geometry AS $$
|
RETURNS Geometry AS $$
|
||||||
from cartodb_services.metrics import QuotaService
|
from cartodb_services.metrics import QuotaService
|
||||||
|
3733
server/extension/cdb_dataservices_server--0.32.0.sql
Normal file
3733
server/extension/cdb_dataservices_server--0.32.0.sql
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
comment = 'CartoDB dataservices server extension'
|
comment = 'CartoDB dataservices server extension'
|
||||||
default_version = '0.31.0'
|
default_version = '0.32.0'
|
||||||
requires = 'plpythonu, plproxy, postgis, cdb_geocoder'
|
requires = 'plpythonu, plproxy, postgis, cdb_geocoder'
|
||||||
superuser = true
|
superuser = true
|
||||||
schema = cdb_dataservices_server
|
schema = cdb_dataservices_server
|
||||||
|
@ -10,7 +10,7 @@ from setuptools import setup, find_packages
|
|||||||
setup(
|
setup(
|
||||||
name='cartodb_services',
|
name='cartodb_services',
|
||||||
|
|
||||||
version='0.18.0',
|
version='0.19.0',
|
||||||
|
|
||||||
description='CartoDB Services API Python Library',
|
description='CartoDB Services API Python Library',
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user