E
E
Eugene2017-04-06 17:56:13
Node.js
Eugene, 2017-04-06 17:56:13

How to use transactions in koajs + sequelize?

How to wrap it in a transaction?

app.use(_.post('/books', function *() {
  var book = yield Book.create({});
  yield book.addOwner(this.user);
}));

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2021-03-03
@Nc_Soft

Everything is in the documentation https://sequelize.org/master/manual/transactions.html
var, yield, function *()
what year is it? 2017?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question