Differences From
Artifact [d567971842]:
15 15 select p.id as post,
16 16 coalesce((select counts.ct from counts where counts.subject = p.id
17 17 and counts.kind = 'like'),0)::integer as likes,
18 18 coalesce((select counts.ct from counts where counts.subject = p.id
19 19 and counts.kind = 'rt' ),0)::integer as rts
20 20 from parsav_posts as p
21 21 );
22 +
23 +create type pg_temp.parsavpg_intern_artifact as (
24 + rid bigint,
25 + owner bigint,
26 + "desc" text,
27 + folder text,
28 + mime text
29 +);
30 +
31 +create or replace function
32 +pg_temp.parsavpg_translate_artifact(parsav_artifact_claims)
33 +returns pg_temp.parsavpg_intern_artifact as $$
34 + select ($1).rid, ($1).uid, ($1).description, ($1).folder, a.mime
35 + from parsav_artifacts a where
36 + a.id = ($1).rid limit 1
37 +$$ language sql;
22 38
23 39 create type pg_temp.parsavpg_intern_notice as (
24 40 kind smallint,
25 41 "when" bigint,
26 42 who bigint,
27 43 what bigint,
28 44 reply bigint,