Skip to content

Instantly share code, notes, and snippets.

@KadekM
Created March 17, 2021 15:07
Show Gist options
  • Save KadekM/933a0f7d7a2b907d965ada80d2177e1f to your computer and use it in GitHub Desktop.
Save KadekM/933a0f7d7a2b907d965ada80d2177e1f to your computer and use it in GitHub Desktop.
def changeBalanceCommand =
sql"""INSERT INTO balances (name, balance) VALUES ($varchar, $int4)
ON CONFLICT (name) DO UPDATE
SET balance=EXCLUDED.balance + balances.balance""".command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment