Skip to content

Commit

Permalink
fix: close
Browse files Browse the repository at this point in the history
  • Loading branch information
Elin Angelow committed Dec 21, 2023
1 parent 7a20818 commit 6b31bcd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/mssql/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ const Link = async(config) => {
throw e;
}
},
request: () => cPool.request()
request: () => cPool.request(),
close: () => cPool.close()
};
};

Expand Down Expand Up @@ -296,5 +297,10 @@ module.exports = async(config) => {
const tt = await tableTypes();
const methods = await build(tt);

return methods;
return {
methods,
async stop() {
return await link.close();
}
};
};
3 changes: 3 additions & 0 deletions lib/postgres/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ module.exports = async(config) => {

return {
methods,
async stop() {
return await link.end();
},
async txBegin() {
const id = ++txId;
const client = await link.connect();
Expand Down

0 comments on commit 6b31bcd

Please sign in to comment.