UNPKG

mssql2

Version:

Microsoft SQL Server client for Node.js (fork)

36 lines (32 loc) 1.04 kB
// Generated by CoffeeScript 1.10.0 (function() { var error, ex; try { if (require('tds/package.json').version !== '0.1.0') { return; } /* Fixed typing error in UniqueIdentifier */ require('tds/lib/tds-constants.js').TdsConstants.dataTypesByName.GUIDTYPE.sqlType = 'UniqueIdentifier'; require('tds').Connection.prototype.setAutoCommit = function(autoCommit, autoCommitCallback) { if (this._autoCommit === autoCommit) { return autoCommitCallback(); // <- fix here } else { if (this._currentStatement != null) { throw new Error('Cannot change auto commit while statement is executing'); } this._pendingCallback = autoCommitCallback; this._currentStatement = '#setAutoCommit'; if (autoCommit) { return this._client.sqlBatch('SET IMPLICIT_TRANSACTIONS OFF'); } else { return this._client.sqlBatch('SET IMPLICIT_TRANSACTIONS ON'); } } };; } catch (error) { ex = error; console.log(ex); } }).call(this);