Skip to main content

max / makenotwork

1.9 KB · 68 lines History Blame Raw
1 {
2 "db_name": "PostgreSQL",
3 "query": "SELECT t.id, t.title,\n COALESCE(u.display_name, u.username) AS \"author_name!\",\n u.username AS author_username,\n GREATEST(t.post_count - 1, 0)::BIGINT AS \"reply_count!\",\n t.last_activity_at AS \"last_activity_at: chrono::DateTime<chrono::Utc>\",\n t.pinned, t.locked\n FROM threads t\n JOIN categories c ON c.id = t.category_id\n JOIN communities co ON co.id = c.community_id\n JOIN users u ON u.mnw_account_id = t.author_id\n WHERE co.slug = $1 AND c.slug = $2 AND t.deleted_at IS NULL\n ORDER BY t.pinned DESC, t.last_activity_at DESC\n LIMIT $3 OFFSET $4",
4 "describe": {
5 "columns": [
6 {
7 "ordinal": 0,
8 "name": "id",
9 "type_info": "Uuid"
10 },
11 {
12 "ordinal": 1,
13 "name": "title",
14 "type_info": "Text"
15 },
16 {
17 "ordinal": 2,
18 "name": "author_name!",
19 "type_info": "Text"
20 },
21 {
22 "ordinal": 3,
23 "name": "author_username",
24 "type_info": "Text"
25 },
26 {
27 "ordinal": 4,
28 "name": "reply_count!",
29 "type_info": "Int8"
30 },
31 {
32 "ordinal": 5,
33 "name": "last_activity_at: chrono::DateTime<chrono::Utc>",
34 "type_info": "Timestamptz"
35 },
36 {
37 "ordinal": 6,
38 "name": "pinned",
39 "type_info": "Bool"
40 },
41 {
42 "ordinal": 7,
43 "name": "locked",
44 "type_info": "Bool"
45 }
46 ],
47 "parameters": {
48 "Left": [
49 "Text",
50 "Text",
51 "Int8",
52 "Int8"
53 ]
54 },
55 "nullable": [
56 false,
57 false,
58 null,
59 false,
60 null,
61 false,
62 false,
63 false
64 ]
65 },
66 "hash": "c19d5ccb1774690260d9aa1b5dec7511605cb55fe9a9620a14706cde96d5ca6a"
67 }
68