Add properties for user and geocoder config keys instead of hardcode it in the template

This commit is contained in:
Mario de Frutos
2015-11-23 13:09:03 +01:00
parent e09af1463d
commit 963da6c5c7
3 changed files with 30 additions and 4 deletions

View File

@@ -8,11 +8,11 @@ CREATE OR REPLACE FUNCTION <%= GEOCODER_CLIENT_SCHEMA %>.<%= name %> (<%= params
RETURNS <%= return_type %> AS $$
DECLARE
ret <%= return_type %>;
user_config JSON;
geocoder_config JSON;
user_config json;
geocoder_config json;
BEGIN
SELECT cartodb.CDB_Conf_GetConf('user_config') INTO user_config;
SELECT cartodb.CDB_Conf_GetConf('geocoder_config') INTO geocoder_config;
SELECT cartodb.CDB_Conf_GetConf('<%= user_config_key %>') INTO user_config;
SELECT cartodb.CDB_Conf_GetConf('<%= geocoder_config_key %>') INTO geocoder_config;
SELECT <%= GEOCODER_CLIENT_SCHEMA %>._<%= name %>(session_user, user_config, geocoder_config, <%= params %>) INTO ret;
RETURN ret;
END;