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:
parent
5a33e0bc02
commit
31ef9d54f2
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user