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

Commit db6d5ec6 by Wong Yong Jie Committed by GitHub

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

1 parent d89dedea
...@@ -47,7 +47,7 @@ export interface Transactionable { ...@@ -47,7 +47,7 @@ export interface Transactionable {
/** /**
* Transaction to run query under * Transaction to run query under
*/ */
transaction?: Transaction; transaction?: Transaction | null;
} }
export interface SearchPathable { export interface SearchPathable {
......
...@@ -78,3 +78,9 @@ async function nestedTransact() { ...@@ -78,3 +78,9 @@ async function nestedTransact() {
}); });
await tr.commit(); 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!