summaryrefslogtreecommitdiff
path: root/sql/functions/general.get_gallery.sql
diff options
context:
space:
mode:
authorckonstanski <carlos.konstanski@olo.com>2024-05-27 14:52:07 -0600
committerckonstanski <carlos.konstanski@olo.com>2024-05-27 14:52:07 -0600
commite30ee019294e2abbbd3644b73e4327ae17df4392 (patch)
tree44d03581f96d81e0990f0664c01e725de542e9c2 /sql/functions/general.get_gallery.sql
parent42e351bb04d38b01a1d5b251cdbc0caaa4be3712 (diff)
gallery
Diffstat (limited to 'sql/functions/general.get_gallery.sql')
-rw-r--r--sql/functions/general.get_gallery.sql24
1 files changed, 24 insertions, 0 deletions
diff --git a/sql/functions/general.get_gallery.sql b/sql/functions/general.get_gallery.sql
new file mode 100644
index 0000000..66c9fce
--- /dev/null
+++ b/sql/functions/general.get_gallery.sql
@@ -0,0 +1,24 @@
+drop function general.get_gallery (
+ p_id bigint
+);
+
+create or replace function general.get_gallery (
+ p_id bigint
+)
+returns setof general.gallery_t
+as $$
+begin
+ return query
+ select g.id,
+ g.description,
+ g.filename,
+ g.mime_type,
+ substring(g.content::text from 3) as content,
+ g.created,
+ g.modified
+ from general.gallery g
+ where g.id = p_id;
+
+ return;
+end;
+$$ language plpgsql;