Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh
5 linesCodeBlameRaw
1INSERT INTO plan_payments (invoice_id, workspace, amount_micros, paid_at)
2SELECT ?4, ?2, -(?3 - already), ?5
3FROM (SELECT -(COALESCE((SELECT SUM(amount_micros) FROM plan_payments WHERE invoice_id LIKE ?6), 0)
4 + COALESCE((SELECT SUM(amount_micros) FROM ledger WHERE reference LIKE ?6), 0)) AS already)
5WHERE ?3 > already AND ?1 IS NOT NULL