4 ms·
Don't have separate get / set functions? async function changeBalance(account, amt) { /* * BEGIN; * * UPDATE accounts
by candu 7y ago
Don't have separate get / set functions?
async function changeBalance(account, amt) {
/*
* BEGIN;
*
* UPDATE accounts
* SET balance = balance - amt
* WHERE id = ${id};
*
* COMMIT;
*/
}
Of course, this is just a mutex in database transaction clothing :)