diff --git a/scripts-available/CDB_FederatedServerDiagnostics.sql b/scripts-available/CDB_FederatedServerDiagnostics.sql new file mode 100644 index 0000000..7b16263 --- /dev/null +++ b/scripts-available/CDB_FederatedServerDiagnostics.sql @@ -0,0 +1,12 @@ +-------------------------------------------------------------------------------- +-- Public functions +-------------------------------------------------------------------------------- + +CREATE OR REPLACE FUNCTION @extschema@.CDB_Federated_Server_Diagnostics(server TEXT) +RETURNS json -- TODO decide if json or jsonb +AS $$ +BEGIN + RETURN '{}'::json; +END +$$ +LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE; diff --git a/scripts-enabled/403-CDB_FederatedServerDiagnostics.sql b/scripts-enabled/403-CDB_FederatedServerDiagnostics.sql new file mode 120000 index 0000000..edab4d4 --- /dev/null +++ b/scripts-enabled/403-CDB_FederatedServerDiagnostics.sql @@ -0,0 +1 @@ +../scripts-available/CDB_FederatedServerDiagnostics.sql \ No newline at end of file diff --git a/test/CDB_FederatedServerDiagnostics.sql b/test/CDB_FederatedServerDiagnostics.sql new file mode 100644 index 0000000..d0af580 --- /dev/null +++ b/test/CDB_FederatedServerDiagnostics.sql @@ -0,0 +1,2 @@ +\echo '%% It raises an error if the server does not exist' +SELECT '1.1', cartodb.CDB_Federated_Server_Diagnostics(server => 'doesNotExist'); diff --git a/test/CDB_FederatedServerDiagnostics_expect b/test/CDB_FederatedServerDiagnostics_expect new file mode 100644 index 0000000..ea8ac49 --- /dev/null +++ b/test/CDB_FederatedServerDiagnostics_expect @@ -0,0 +1,2 @@ +%% It raises an error if the server does not exist +1.1|{}