This commit is contained in:
2024-11-01 16:09:16 +01:00
parent 1e7f878a64
commit b2429246e4
10 changed files with 234 additions and 0 deletions

View File

@ -0,0 +1,19 @@
CREATE OR REPLACE FUNCTION get_urls_and_paths(website_name text)
RETURNS TABLE (
out_url text,
out_website_name text
) AS
$$
BEGIN
RETURN QUERY SELECT aw.url, aw.folder_path
FROM artist_website aw
INNER JOIN website w ON aw.website_id = w.id
WHERE w.name ILIKE website_name;
IF NOT FOUND THEN
RAISE EXCEPTION 'No urls and paths found for website: %', website_name;
END IF;
RETURN;
END;
$$ LANGUAGE plpgsql;