45 lines
1.7 KiB
JSON
45 lines
1.7 KiB
JSON
{
|
|
"db_name": "PostgreSQL",
|
|
"query": "\n WITH\n updated_creator AS (\n UPDATE af_template_creator\n SET name = $2, avatar_url = $3, updated_at = NOW()\n WHERE creator_id = $1\n RETURNING creator_id, name, avatar_url\n ),\n account_links AS (\n INSERT INTO af_template_creator_account_link (creator_id, link_type, url)\n SELECT updated_creator.creator_id as creator_id, link_type, url FROM\n UNNEST($4::text[], $5::text[]) AS t(link_type, url)\n CROSS JOIN updated_creator\n RETURNING\n creator_id,\n link_type,\n url\n )\n SELECT\n updated_creator.creator_id AS id,\n name,\n avatar_url,\n ARRAY_AGG((link_type, url)) FILTER (WHERE link_type IS NOT NULL) AS \"account_links: Vec<AccountLinkColumn>\"\n FROM updated_creator\n LEFT OUTER JOIN account_links\n ON updated_creator.creator_id = account_links.creator_id\n GROUP BY (id, name, avatar_url)\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"
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Left": [
|
|
"Uuid",
|
|
"Text",
|
|
"Text",
|
|
"TextArray",
|
|
"TextArray"
|
|
]
|
|
},
|
|
"nullable": [
|
|
false,
|
|
false,
|
|
false,
|
|
null
|
|
]
|
|
},
|
|
"hash": "fcf9b5bd2d2184fc2041bb0ddfe4ee89c24c5bf7613f4e8641acf739c00ffc17"
|
|
}
|