Export helpers/generic functions to a new file

This commit is contained in:
xbgmsharp
2023-04-23 11:00:40 +02:00
parent ae14017cfc
commit 578ca925db
2 changed files with 137 additions and 12 deletions

View File

@@ -51,7 +51,7 @@ CREATE OR REPLACE FUNCTION logbook_update_avg_fn(
OUT avg_speed double precision,
OUT max_speed double precision,
OUT max_wind_speed double precision,
OUT count_metric double precision
OUT count_metric integer
) AS $logbook_update_avg$
BEGIN
RAISE NOTICE '-> Updating avg for logbook id=%, start:"%", end:"%"', _id, _start, _end;
@@ -652,17 +652,6 @@ COMMENT ON FUNCTION
public.get_app_settings_fn
IS 'get app settings details, email, pushover, telegram';
CREATE FUNCTION jsonb_key_exists(some_json jsonb, outer_key text)
RETURNS BOOLEAN AS $$
BEGIN
RETURN (some_json->outer_key) IS NOT NULL;
END;
$$ LANGUAGE plpgsql;
-- Description
COMMENT ON FUNCTION
public.jsonb_key_exists
IS 'function that checks if an outer key exists in some_json and returns a boolean';
-- Send notifications
DROP FUNCTION IF EXISTS send_notification_fn;
CREATE OR REPLACE FUNCTION send_notification_fn(