You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const{ Transaction }=ilorm;Transaction.run(async()=>{// everything here is in the transactionconstaccount=awaitaccount.query().findOne({ ... });if(account.balance>amountMoney){item.isBuyed=true;account.balance-=amountMoney;awaitPromise.all([item.save(),account.save(),]);}});
More declarative one;
Transaction.run(async(trx)=>{// everything here is in the transactionconstaccount=awaitaccount.query(trx).findOne({ ... });if(account.balance>amountMoney){item.isBuyed=true;account.balance-=amountMoney;awaitPromise.all([item.save(trx),account.save(trx),]);}});
Support a transaction system make sense;
API proposal (with async local storage);
More declarative one;
Exception cancel transaction? 🤔
Quid multi connector / ilorm?
Alternative syntax;
The text was updated successfully, but these errors were encountered: