Rename function for clarity

__ft_add_default_options renamed to __ft_add_default_readonly_options
to state clearly it is for the read only configuration.
This commit is contained in:
Rafa de la Torre 2019-10-11 11:14:09 +02:00
parent 5a33e0bc02
commit 31ef9d54f2
2 changed files with 4 additions and 4 deletions

View File

@ -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@.__ft_add_default_options(input_config jsonb) CREATE OR REPLACE FUNCTION @extschema@.__ft_add_default_readonly_options(input_config jsonb)
RETURNS jsonb RETURNS jsonb
AS $$ AS $$
DECLARE DECLARE
@ -125,7 +125,7 @@ DECLARE
final_config jsonb; final_config jsonb;
BEGIN BEGIN
final_config := @extschema@.__ft_credentials_to_user_mapping( final_config := @extschema@.__ft_credentials_to_user_mapping(
@extschema@.__ft_add_default_options(server_config) @extschema@.__ft_add_default_readonly_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

@ -709,7 +709,7 @@ EOF
sql postgres "SELECT cartodb.__ft_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 __ft_add_default_options # Unit-test __ft_add_default_readonly_options
read -d '' expected_default_options <<- EOF read -d '' expected_default_options <<- EOF
{ {
"server": { "server": {
@ -727,7 +727,7 @@ EOF
} }
} }
EOF EOF
sql postgres "SELECT cartodb.__ft_add_default_options('$federated_server_config') = '$expected_default_options'" \ sql postgres "SELECT cartodb.__ft_add_default_readonly_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