Skip to content

Commit 7bbf59c

Browse files
committed
proper closing connection
1 parent c19095d commit 7bbf59c

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12+
node-version:
13+
- 20
14+
- 22
15+
- 24
1216
image:
13-
- 2024.3
1417
- latest-em
1518
- latest-preview
1619
services:
@@ -25,7 +28,7 @@ jobs:
2528
- uses: actions/checkout@v4
2629
- uses: actions/setup-node@v4
2730
with:
28-
node-version: 20
31+
node-version: ${{ matrix.node-version }}
2932
cache: "npm"
3033
- run: docker exec iris iris session iris -U%SYS '##class(Security.Users).UnExpireUserPasswords("*")'
3134
- run: npm ci

src/IRISDriver.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { InstanceChecker } from "typeorm/util/InstanceChecker"
2424
import { UpsertType } from "typeorm/driver/types/UpsertType"
2525
import { TypeORMError } from "typeorm/error/TypeORMError"
2626
import { IRISNative } from "./IRISNative"
27+
import { ConnectionIsNotSetError } from "typeorm"
2728

2829
/**
2930
* Organizes communication with InterSystems IRIS.
@@ -331,7 +332,14 @@ export class IRISDriver implements Driver {
331332
/**
332333
* Closes connection with the database.
333334
*/
334-
async disconnect(): Promise<void> {}
335+
async disconnect(): Promise<void> {
336+
if (!this.master) {
337+
throw new ConnectionIsNotSetError("iris")
338+
}
339+
340+
this.master.close()
341+
this.master = undefined
342+
}
335343

336344
/**
337345
* Creates a schema builder used to build and sync a schema.

0 commit comments

Comments
 (0)