Node.js 7 and up already support async/await syntax. How should I use async/await with sequelize transactions?
The answer given by user7403683 describes async/await way for unmanaged transaction (http://docs.sequelizejs.com/manual/tutorial/transactions.html#unmanaged-transaction-then-callback-)
Managed transaction in async/await style may look as follows:
await sequelize.transaction( async t=>{
const user = User.create( { name: "Alex", pwd: "2dwe3dcd" }, { transaction: t} )
const group = Group.findOne( { name: "Admins", transaction: t} )
// etc.
})
If error occurs, the transaction is automatically rolled back.