Skip to main content

max / makenotwork

1.1 KB · 39 lines History Blame Raw
1 {
2 "db_name": "PostgreSQL",
3 "query": "\n SELECT\n currency AS \"currency!: SettlementCurrency\",\n COALESCE(SUM(CASE WHEN status = 'completed' THEN amount_cents ELSE 0 END), 0)::BIGINT AS \"revenue!\",\n COALESCE(SUM(CASE WHEN status = 'completed' THEN 1 ELSE 0 END), 0)::BIGINT AS \"completed!\",\n COALESCE(SUM(CASE WHEN status = 'refunded' THEN 1 ELSE 0 END), 0)::BIGINT AS \"refunded!\"\n FROM transactions\n GROUP BY currency\n ",
4 "describe": {
5 "columns": [
6 {
7 "ordinal": 0,
8 "name": "currency!: SettlementCurrency",
9 "type_info": "Varchar"
10 },
11 {
12 "ordinal": 1,
13 "name": "revenue!",
14 "type_info": "Int8"
15 },
16 {
17 "ordinal": 2,
18 "name": "completed!",
19 "type_info": "Int8"
20 },
21 {
22 "ordinal": 3,
23 "name": "refunded!",
24 "type_info": "Int8"
25 }
26 ],
27 "parameters": {
28 "Left": []
29 },
30 "nullable": [
31 false,
32 null,
33 null,
34 null
35 ]
36 },
37 "hash": "e1915e84f6f9043f4252e1d6c1c45f6b128a6b837003a5d1bd24128eb58b75e1"
38 }
39