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

Commit 4416eff9 by Harshith Kashyap Committed by Jan Aagaard Meier

MSSQL - Skip isolationLevel query, enable tedious debugging (#7130)

* MSSQL - Skip isolationLevel query, enable tedious debugging

* Added changelog entry, updated docs
1 parent f14f6cdf
# Future
- [CHANGED] `setIsolationLevelQuery` to skip under MSSQL dialect, added debug listener for tedious [#7130](https://github.com/sequelize/sequelize/pull/7130)
- [FIXED] `removeColumn` method to support dropping primaryKey column (MSSQL) [#7081](https://github.com/sequelize/sequelize/pull/7081)
- [ADDED] Filtered Indexes support for SQL Server [#7016](https://github.com/sequelize/sequelize/issues/7016)
- [FIXED] Set `timestamps` and `paranoid` options from through model on `belongsToMany` association
......
......@@ -134,6 +134,8 @@ return sequelize.transaction({
});
```
Note: The SET ISOLATION LEVEL queries are not logged in case of MSSQL as the specified isolationLevel is passed directly to tedious
# Unmanaged transaction (then-callback)
Unmanaged transactions force you to manually rollback or commit the transaction. If you don't do that, the transaction will hang until it times out. To start an unmanaged transaction, call `sequelize.transaction()` without a callback (you can still pass an options object) and call `then` on the returned promise. Notice that `commit()` and `rollback()` returns a promise.
......
......@@ -5,6 +5,7 @@ const ResourceLock = require('./resource-lock');
const Promise = require('../../promise');
const Utils = require('../../utils');
const debug = Utils.getLogger().debugContext('connection:mssql');
const debugTedious = Utils.getLogger().debugContext('connection:mssql:tedious');
const sequelizeErrors = require('../../errors');
const parserStore = require('../parserStore')('mssql');
const _ = require('lodash');
......@@ -110,6 +111,10 @@ class ConnectionManager extends AbstractConnectionManager {
break;
}
});
if (config.dialectOptions.debug) {
connection.on('debug', debugTedious);
}
if (config.pool.handleDisconnects) {
connection.on('error', err => {
......
......@@ -730,11 +730,7 @@ var QueryGenerator = {
},
setIsolationLevelQuery(value, options) {
if (options.parent) {
return;
}
return 'SET TRANSACTION ISOLATION LEVEL ' + value + ';';
},
generateTransactionId() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!