{ "db_name": "PostgreSQL", "query": "SELECT u.mnw_account_id AS user_id,\n u.username,\n u.display_name,\n u.avatar_url,\n m.role AS \"role: CommunityRole\",\n m.joined_at AS \"joined_at: chrono::DateTime\",\n (SELECT COUNT(*) FROM posts p\n JOIN threads t ON t.id = p.thread_id\n JOIN categories c ON c.id = t.category_id\n WHERE p.author_id = u.mnw_account_id\n AND c.community_id = co.id\n AND p.removed_at IS NULL\n AND p.deleted_at IS NULL\n AND t.deleted_at IS NULL) AS \"post_count!\",\n (SELECT COUNT(*) FROM post_endorsements pe\n JOIN posts p ON p.id = pe.post_id\n JOIN threads t ON t.id = p.thread_id\n JOIN categories c ON c.id = t.category_id\n WHERE p.author_id = u.mnw_account_id\n AND c.community_id = co.id\n AND p.removed_at IS NULL\n AND p.deleted_at IS NULL\n AND t.deleted_at IS NULL) AS \"endorsement_count!\"\n FROM users u\n JOIN memberships m ON m.user_id = u.mnw_account_id\n JOIN communities co ON co.id = m.community_id\n WHERE co.slug = $1 AND u.username = $2", "describe": { "columns": [ { "ordinal": 0, "name": "user_id", "type_info": "Uuid" }, { "ordinal": 1, "name": "username", "type_info": "Text" }, { "ordinal": 2, "name": "display_name", "type_info": "Text" }, { "ordinal": 3, "name": "avatar_url", "type_info": "Text" }, { "ordinal": 4, "name": "role: CommunityRole", "type_info": "Text" }, { "ordinal": 5, "name": "joined_at: chrono::DateTime", "type_info": "Timestamptz" }, { "ordinal": 6, "name": "post_count!", "type_info": "Int8" }, { "ordinal": 7, "name": "endorsement_count!", "type_info": "Int8" } ], "parameters": { "Left": [ "Text", "Text" ] }, "nullable": [ false, false, true, true, false, false, null, null ] }, "hash": "cb23b4f88ed4d2395a72f1372a938724332cae7326201b3932f19c769ff65b49" }