53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
...
208
209
210
211
212
213
214
215
216
217
218
219
|
($1).time,
($1).actor,
($1).subject,
null::bigint,
($1).body
)::pg_temp.parsavpg_intern_notice as notice
from (values
('rt', <notice:rt> ),
('like', <notice:like> ),
('react', <notice:react>)
) as kmap(kstr,kind) where kmap.kstr = ($1).kind
$$ language sql;
create type pg_temp.parsavpg_intern_actor as (
id bigint,
nym text,
handle text,
................................................................................
null::text
)::pg_temp.parsavpg_intern_notice as notice,
par.author as rcpt
from parsav_posts as p
inner join parsav_posts as par on p.parent = par.id
left join ntimes as nt on nt.uid = p.author
where p.discovered >= coalesce(nt.when,0)
), allnotices as (select * from acts union select * from replies)
table allnotices order by (notice).when desc
);
|
|
|
|
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
...
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
($1).time,
($1).actor,
($1).subject,
null::bigint,
($1).body
)::pg_temp.parsavpg_intern_notice as notice
from (values
('rt', <notice:rt> ),
('like', <notice:like> ),
('react', <notice:react> ),
('follow',<notice:follow>)
) as kmap(kstr,kind) where kmap.kstr = ($1).kind
$$ language sql;
create type pg_temp.parsavpg_intern_actor as (
id bigint,
nym text,
handle text,
................................................................................
null::text
)::pg_temp.parsavpg_intern_notice as notice,
par.author as rcpt
from parsav_posts as p
inner join parsav_posts as par on p.parent = par.id
left join ntimes as nt on nt.uid = p.author
where p.discovered >= coalesce(nt.when,0)
), follows as (
select row(
<notice:follow>::smallint,
r.since,
r.relator,
r.relatee,
null::bigint,
null::text
)::pg_temp.parsavpg_intern_notice as notice,
r.relatee as rcpt
from parsav_rels as r
left join ntimes as nt on nt.uid = r.relatee
where
r.since >= coalesce(nt.when,0) and
r.kind = <rel:follow>
), allnotices as (table acts union table replies union table follows)
table allnotices order by (notice).when desc
);
|