chore(*.sql): use sql-formatter for sql formatting
This commit is contained in:
parent
753f3433ce
commit
a650f1d3e8
63 changed files with 4432 additions and 2358 deletions
|
@ -7,24 +7,45 @@ SELECT
|
|||
l.link,
|
||||
a.mastodon,
|
||||
a.name,
|
||||
json_build_object('name', a.name, 'url', a.url, 'mastodon', a.mastodon) AS author,
|
||||
json_build_object(
|
||||
'name',
|
||||
a.name,
|
||||
'url',
|
||||
a.url,
|
||||
'mastodon',
|
||||
a.mastodon
|
||||
) AS author,
|
||||
'link' AS type,
|
||||
(
|
||||
SELECT array_agg(t.name)
|
||||
FROM links_tags lt
|
||||
LEFT JOIN tags t ON lt.tags_id = t.id
|
||||
WHERE lt.links_id = l.id
|
||||
SELECT
|
||||
array_agg(t.name)
|
||||
FROM
|
||||
links_tags lt
|
||||
LEFT JOIN tags t ON lt.tags_id = t.id
|
||||
WHERE
|
||||
lt.links_id = l.id
|
||||
) AS tags,
|
||||
json_build_object(
|
||||
'title', CONCAT(l.title, ' via ', a.name),
|
||||
'url', l.link,
|
||||
'description', l.description,
|
||||
'date', l.date
|
||||
'title',
|
||||
CONCAT(l.title, ' via ', a.name),
|
||||
'url',
|
||||
l.link,
|
||||
'description',
|
||||
l.description,
|
||||
'date',
|
||||
l.date
|
||||
) AS feed
|
||||
FROM
|
||||
links l
|
||||
JOIN authors a ON l.author = a.id
|
||||
GROUP BY
|
||||
l.id, l.title, l.date, l.description, l.link, a.mastodon, a.name, a.url
|
||||
l.id,
|
||||
l.title,
|
||||
l.date,
|
||||
l.description,
|
||||
l.link,
|
||||
a.mastodon,
|
||||
a.name,
|
||||
a.url
|
||||
ORDER BY
|
||||
l.date DESC;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue