Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
{
"db_name": "PostgreSQL",
"query": "\n WITH sources AS (\n SELECT DISTINCT id, auth_entity\n FROM UNNEST($1::text[], $2::text[]) AS source(id, auth_entity)\n )\n SELECT\n label.value ->> 'name' AS \"name!\",\n (ARRAY_AGG(\n label.value ->> 'color'\n ORDER BY gpr.updated_at DESC, gpr.github_key\n ) FILTER (WHERE label.value ->> 'color' IS NOT NULL))[1] AS color,\n COUNT(*) AS \"count!\"\n FROM github_pull_request gpr\n CROSS JOIN LATERAL jsonb_array_elements(gpr.labels) AS label(value)\n WHERE label.value ->> 'name' IS NOT NULL\n AND EXISTS (\n SELECT 1\n FROM foreign_entity fe\n JOIN sources s\n ON s.id = fe.stored_for_id AND s.auth_entity = fe.stored_for_auth_entity\n WHERE fe.foreign_entity_source = $3::text\n AND fe.foreign_entity_id = gpr.github_key\n )\n GROUP BY label.value ->> 'name'\n ORDER BY COUNT(*) DESC, label.value ->> 'name'\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "name!",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "color",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "count!",
"type_info": "Int8"
}
],
"parameters": {
"Left": [
"TextArray",
"TextArray",
"Text"
]
},
"nullable": [
null,
null,
null
]
},
"hash": "2e6c5fcef08f452f991c242e69bfce66be61a806cc97a2c0aaa1a883bf865f77"
}