Skip to content

Commit 4e54d26

Browse files
committed
Added options to beginTransaction
1 parent 4764e9a commit 4e54d26

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/transaction.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ function mixinTransaction(PostgreSQL) {
1919
* @param isolationLevel
2020
* @param cb
2121
*/
22-
PostgreSQL.prototype.beginTransaction = function(isolationLevel, cb) {
22+
PostgreSQL.prototype.beginTransaction = function(isolationLevel, options, cb) {
23+
24+
if ((!cb) && typeof options === 'function') {
25+
cb = options;
26+
options = {};
27+
}
28+
options = options || {};
29+
2330
const connector = this;
2431
debug('Begin a transaction with isolation level: %s', isolationLevel);
2532
this.pg.connect(function(err, connection, done) {

0 commit comments

Comments
 (0)