Skip to main content

max / makenotwork

1.4 KB · 39 lines History Blame Raw
1 {
2 "db_name": "PostgreSQL",
3 "query": "\n UPDATE transactions\n SET platform_credit_claimed_at = NOW()\n WHERE id = (\n SELECT id FROM transactions\n WHERE status = 'completed'\n AND platform_credit_cents > 0\n AND platform_credit_settled_at IS NULL\n AND platform_credit_claimed_at IS NULL\n ORDER BY completed_at\n LIMIT 1\n FOR UPDATE SKIP LOCKED\n )\n RETURNING id AS \"transaction_id!: TransactionId\",\n seller_id AS \"seller_id!: UserId\",\n platform_credit_cents AS \"amount_cents!: Cents\",\n currency AS \"currency!: crate::currency::SettlementCurrency\"\n ",
4 "describe": {
5 "columns": [
6 {
7 "ordinal": 0,
8 "name": "transaction_id!: TransactionId",
9 "type_info": "Uuid"
10 },
11 {
12 "ordinal": 1,
13 "name": "seller_id!: UserId",
14 "type_info": "Uuid"
15 },
16 {
17 "ordinal": 2,
18 "name": "amount_cents!: Cents",
19 "type_info": "Int8"
20 },
21 {
22 "ordinal": 3,
23 "name": "currency!: crate::currency::SettlementCurrency",
24 "type_info": "Varchar"
25 }
26 ],
27 "parameters": {
28 "Left": []
29 },
30 "nullable": [
31 false,
32 true,
33 false,
34 false
35 ]
36 },
37 "hash": "9f5a1e3d4e860830908c3eb4ed56c6e4136b55fdd045405784f359f4edb73929"
38 }
39