Skip to content

Commit 329d94a

Browse files
authored
Merge pull request #603 from bcomnes/fix-executeSql
Fix support for executeSql
2 parents d6405e0 + eed1dea commit 329d94a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/manager.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,9 @@ class Manager extends EventEmitter {
680680
return options.db
681681
}
682682

683-
assert(this.db._pgbdb && this.db.opened, 'Database connection is not opened')
683+
// Custom db objects (without _pgbdb flag) are assumed to be ready
684+
// Only check opened flag for pg-boss managed db instances
685+
assert(!this.db._pgbdb || (this.db._pgbdb && this.db.opened), 'Database connection is not opened')
684686

685687
return this.db
686688
}

0 commit comments

Comments
 (0)