$FUNC$ LANGUAGE PLPGSQL;
+CREATE OR REPLACE FUNCTION actor.get_setting_batch(setting_names TEXT[],
+ org_id INT, user_id INT, workstation_id INT) RETURNS SETOF JSON AS
+$FUNC$
+-- Returns a row per setting matching the setting name order. If no
+-- value is applied, NULL is returned to retain name-response ordering.
+DECLARE
+ setting_name TEXT;
+BEGIN
+ FOREACH setting_name IN ARRAY setting_names LOOP
+ RETURN NEXT * FROM actor.get_setting(
+ setting_Name, org_id, user_id, workstation_id);
+ END LOOP;
+END;
+$FUNC$ LANGUAGE PLPGSQL;
+
COMMIT;
+
BEGIN;
DROP FUNCTION actor.get_setting(TEXT, INT, INT, INT);
+DROP FUNCTION actor.get_setting_batch(TEXT[], INT, INT, INT);
DROP TRIGGER IF EXISTS check_setting_is_usr_or_ws ON actor.workstation_setting;
DROP TRIGGER IF EXISTS check_setting_is_usr_or_ws ON actor.usr_setting;