mirror of
https://github.com/AppFlowy-IO/AppFlowy-Cloud.git
synced 2025-04-19 03:24:42 -04:00
* feat: template crud endpoint * fix: clippy error * fix: categories for related view * fix: add created at and last updated at to template response * feat: template api delete endpoint * feat: include number of template count for template creator * fix: use params instead of individual fields for template api * fix: seach template creator by name query * chore: simplify query * feat: support template count limit for template homepage
46 lines
1.6 KiB
JSON
46 lines
1.6 KiB
JSON
{
|
|
"db_name": "PostgreSQL",
|
|
"query": "\n WITH creator_number_of_templates AS (\n SELECT\n creator_id,\n COUNT(1)::int AS number_of_templates\n FROM af_template_view\n WHERE name ILIKE $1\n GROUP BY creator_id\n )\n\n SELECT\n creator.creator_id AS \"id!\",\n name AS \"name!\",\n avatar_url AS \"avatar_url!\",\n ARRAY_AGG((link_type, url)) FILTER (WHERE link_type IS NOT NULL) AS \"account_links: Vec<AccountLinkColumn>\",\n COALESCE(number_of_templates, 0) AS \"number_of_templates!\"\n FROM af_template_creator creator\n LEFT OUTER JOIN af_template_creator_account_link account_link\n USING (creator_id)\n LEFT OUTER JOIN creator_number_of_templates\n USING (creator_id)\n WHERE name ILIKE $1\n GROUP BY (creator.creator_id, name, avatar_url, number_of_templates)\n ORDER BY created_at ASC\n ",
|
|
"describe": {
|
|
"columns": [
|
|
{
|
|
"ordinal": 0,
|
|
"name": "id!",
|
|
"type_info": "Uuid"
|
|
},
|
|
{
|
|
"ordinal": 1,
|
|
"name": "name!",
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"ordinal": 2,
|
|
"name": "avatar_url!",
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"ordinal": 3,
|
|
"name": "account_links: Vec<AccountLinkColumn>",
|
|
"type_info": "RecordArray"
|
|
},
|
|
{
|
|
"ordinal": 4,
|
|
"name": "number_of_templates!",
|
|
"type_info": "Int4"
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Left": [
|
|
"Text"
|
|
]
|
|
},
|
|
"nullable": [
|
|
false,
|
|
false,
|
|
false,
|
|
null,
|
|
null
|
|
]
|
|
},
|
|
"hash": "340b8cef5a7676541b86505cdf103fcb5b54c40a9d6e599dc1d9dc0a95e1e862"
|
|
}
|