Rename private functions

Rename __cdb_* "private" functions to __ft_*, kind of a namespace to
avoid name clashing.
This commit is contained in:
Rafa de la Torre 2019-10-08 17:14:10 +02:00
parent df396bf41f
commit e9b3144390
2 changed files with 8 additions and 8 deletions

View File

@ -4,7 +4,7 @@
-- Take a config jsonb and transform it to an input suitable for -- Take a config jsonb and transform it to an input suitable for
-- _CDB_SetUp_User_PG_FDW_Server -- _CDB_SetUp_User_PG_FDW_Server
CREATE OR REPLACE FUNCTION @extschema@.__cdb_credentials_to_user_mapping(input_config jsonb) CREATE OR REPLACE FUNCTION @extschema@.__ft_credentials_to_user_mapping(input_config jsonb)
RETURNS jsonb RETURNS jsonb
AS $$ AS $$
DECLARE DECLARE
@ -24,7 +24,7 @@ LANGUAGE PLPGSQL IMMUTABLE PARALLEL SAFE;
-- Take a config jsonb as input and return it augmented with default -- Take a config jsonb as input and return it augmented with default
-- options -- options
CREATE OR REPLACE FUNCTION @extschema@.__cdb_add_default_options(input_config jsonb) CREATE OR REPLACE FUNCTION @extschema@.__ft_add_default_options(input_config jsonb)
RETURNS jsonb RETURNS jsonb
AS $$ AS $$
DECLARE DECLARE
@ -63,8 +63,8 @@ AS $$
DECLARE DECLARE
final_config jsonb; final_config jsonb;
BEGIN BEGIN
final_config := @extschema@.__cdb_credentials_to_user_mapping( final_config := @extschema@.__ft_credentials_to_user_mapping(
@extschema@.__cdb_add_default_options(server_config) @extschema@.__ft_add_default_options(server_config)
); );
PERFORM cartodb._CDB_SetUp_User_PG_FDW_Server(server_alias, final_config::json); PERFORM cartodb._CDB_SetUp_User_PG_FDW_Server(server_alias, final_config::json);
END END

View File

@ -690,7 +690,7 @@ function test_federated_tables() {
} }
EOF EOF
# Unit-test __cdb_credentials_to_user_mapping # Unit-test __ft_credentials_to_user_mapping
read -d '' expected_user_mapping <<- EOF read -d '' expected_user_mapping <<- EOF
{ {
"server": { "server": {
@ -704,10 +704,10 @@ EOF
} }
} }
EOF EOF
sql postgres "SELECT cartodb.__cdb_credentials_to_user_mapping('$federated_server_config') = '$expected_user_mapping'" \ sql postgres "SELECT cartodb.__ft_credentials_to_user_mapping('$federated_server_config') = '$expected_user_mapping'" \
should 't' should 't'
# Unit-test __cdb_add_default_options # Unit-test __ft_add_default_options
read -d '' expected_default_options <<- EOF read -d '' expected_default_options <<- EOF
{ {
"server": { "server": {
@ -725,7 +725,7 @@ EOF
} }
} }
EOF EOF
sql postgres "SELECT cartodb.__cdb_add_default_options('$federated_server_config') = '$expected_default_options'" \ sql postgres "SELECT cartodb.__ft_add_default_options('$federated_server_config') = '$expected_default_options'" \
should 't' should 't'
# There must be a function with the expected interface # There must be a function with the expected interface