不要怂,就是干,撸起袖子干!

Commit ced4dc78 by Wong Yong Jie Committed by GitHub

fix(types): allow transaction to be `null` (#13093)

1 parent 365c23af
......@@ -35,7 +35,7 @@ export interface Transactionable {
/**
* Transaction to run query under
*/
transaction?: Transaction;
transaction?: Transaction | null;
}
export interface SearchPathable {
......
......@@ -78,3 +78,9 @@ async function nestedTransact() {
});
await tr.commit();
}
async function excludeFromTransaction() {
await sequelize.transaction(async t =>
await sequelize.query('SELECT 1', { transaction: null })
);
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!