{ "db_name": "PostgreSQL", "query": "\n SELECT p.id AS \"id: ProjectId\", p.title, COALESCE(SUM(t.amount_cents), 0)::BIGINT AS \"revenue!\"\n FROM projects p\n LEFT JOIN items i ON i.project_id = p.id\n LEFT JOIN transactions t ON t.item_id = i.id AND t.status = 'completed'\n WHERE p.user_id = $1\n GROUP BY p.id, p.title\n HAVING COALESCE(SUM(t.amount_cents), 0) > 0\n ORDER BY COALESCE(SUM(t.amount_cents), 0) DESC\n ", "describe": { "columns": [ { "ordinal": 0, "name": "id: ProjectId", "type_info": "Uuid" }, { "ordinal": 1, "name": "title", "type_info": "Varchar" }, { "ordinal": 2, "name": "revenue!", "type_info": "Int8" } ], "parameters": { "Left": [ "Uuid" ] }, "nullable": [ false, false, null ] }, "hash": "ae362df7a9f9899591d1b2e0f722cdf4397d849f9837158e893da24945e18dbc" }