@prairielearn/postgres 1.7.0 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/package.json +8 -8
- package/src/pool.test.ts +8 -8
- package/src/pool.ts +31 -31
- package/src/test-utils.ts +4 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prairielearn/postgres",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,19 +16,19 @@
|
|
|
16
16
|
"@prairielearn/tsconfig": "^0.0.0",
|
|
17
17
|
"@types/mocha": "^10.0.1",
|
|
18
18
|
"@types/multipipe": "^3.0.1",
|
|
19
|
-
"@types/node": "^18.16.
|
|
19
|
+
"@types/node": "^18.16.19",
|
|
20
20
|
"mocha": "^10.2.0",
|
|
21
21
|
"ts-node": "^10.9.1",
|
|
22
|
-
"typescript": "^5.
|
|
22
|
+
"typescript": "^5.1.6"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@types/debug": "^4.1.
|
|
26
|
-
"@types/lodash": "^4.14.
|
|
25
|
+
"@types/debug": "^4.1.8",
|
|
26
|
+
"@types/lodash": "^4.14.195",
|
|
27
27
|
"@types/pg-cursor": "^2.7.0",
|
|
28
28
|
"multipipe": "^4.0.0",
|
|
29
|
-
"pg": "^8.
|
|
30
|
-
"pg-cursor": "^2.
|
|
31
|
-
"pg-pool": "^3.6.
|
|
29
|
+
"pg": "^8.11.1",
|
|
30
|
+
"pg-cursor": "^2.10.1",
|
|
31
|
+
"pg-pool": "^3.6.1",
|
|
32
32
|
"zod": "^3.21.4"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/pool.test.ts
CHANGED
|
@@ -31,7 +31,7 @@ describe('@prairielearn/postgres', function () {
|
|
|
31
31
|
await postgresTestUtils.createDatabase();
|
|
32
32
|
await queryAsync(
|
|
33
33
|
'CREATE TABLE workspaces (id BIGSERIAL PRIMARY KEY, created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP);',
|
|
34
|
-
{}
|
|
34
|
+
{},
|
|
35
35
|
);
|
|
36
36
|
await queryAsync('INSERT INTO workspaces (id) SELECT s FROM generate_series(1, 100) AS s', {});
|
|
37
37
|
});
|
|
@@ -58,7 +58,7 @@ describe('@prairielearn/postgres', function () {
|
|
|
58
58
|
const rows = await queryRows(
|
|
59
59
|
'SELECT * FROM workspaces WHERE id <= $1;',
|
|
60
60
|
[10],
|
|
61
|
-
WorkspaceSchema
|
|
61
|
+
WorkspaceSchema,
|
|
62
62
|
);
|
|
63
63
|
assert.lengthOf(rows, 10);
|
|
64
64
|
});
|
|
@@ -109,7 +109,7 @@ describe('@prairielearn/postgres', function () {
|
|
|
109
109
|
const row = await queryOptionalRow(
|
|
110
110
|
'SELECT * FROM workspaces WHERE id = $1;',
|
|
111
111
|
[1],
|
|
112
|
-
WorkspaceSchema
|
|
112
|
+
WorkspaceSchema,
|
|
113
113
|
);
|
|
114
114
|
assert.isNotNull(row);
|
|
115
115
|
assert.equal(row?.id, '1');
|
|
@@ -118,7 +118,7 @@ describe('@prairielearn/postgres', function () {
|
|
|
118
118
|
it('handles missing result', async () => {
|
|
119
119
|
const row = await queryOptionalRow(
|
|
120
120
|
'SELECT * FROM workspaces WHERE id = -1;',
|
|
121
|
-
WorkspaceSchema
|
|
121
|
+
WorkspaceSchema,
|
|
122
122
|
);
|
|
123
123
|
assert.isNull(row);
|
|
124
124
|
});
|
|
@@ -196,7 +196,7 @@ describe('@prairielearn/postgres', function () {
|
|
|
196
196
|
const cursor = await queryValidatedCursor(
|
|
197
197
|
'SELECT * FROM workspaces WHERE id <= 10 ORDER BY id ASC;',
|
|
198
198
|
{},
|
|
199
|
-
WorkspaceSchema
|
|
199
|
+
WorkspaceSchema,
|
|
200
200
|
);
|
|
201
201
|
const allRows = [];
|
|
202
202
|
for await (const rows of cursor.iterate(10)) {
|
|
@@ -212,7 +212,7 @@ describe('@prairielearn/postgres', function () {
|
|
|
212
212
|
const cursor = await queryValidatedCursor(
|
|
213
213
|
'SELECT * FROM workspaces WHERE id <= 10 ORDER BY id ASC;',
|
|
214
214
|
{},
|
|
215
|
-
BadWorkspaceSchema
|
|
215
|
+
BadWorkspaceSchema,
|
|
216
216
|
);
|
|
217
217
|
|
|
218
218
|
async function readAllRows() {
|
|
@@ -234,7 +234,7 @@ describe('@prairielearn/postgres', function () {
|
|
|
234
234
|
const cursor = await queryValidatedCursor(
|
|
235
235
|
'SELECT * FROM workspaces WHERE id <= 10 ORDER BY id ASC;',
|
|
236
236
|
{},
|
|
237
|
-
WorkspaceSchema
|
|
237
|
+
WorkspaceSchema,
|
|
238
238
|
);
|
|
239
239
|
const stream = cursor.stream(1);
|
|
240
240
|
const allRows = [];
|
|
@@ -249,7 +249,7 @@ describe('@prairielearn/postgres', function () {
|
|
|
249
249
|
const cursor = await queryValidatedCursor(
|
|
250
250
|
'SELECT * FROM workspaces ORDER BY id ASC;',
|
|
251
251
|
{},
|
|
252
|
-
BadWorkspaceSchema
|
|
252
|
+
BadWorkspaceSchema,
|
|
253
253
|
);
|
|
254
254
|
const stream = cursor.stream(1);
|
|
255
255
|
|
package/src/pool.ts
CHANGED
|
@@ -67,7 +67,7 @@ function debugParams(params: QueryParams): string {
|
|
|
67
67
|
*/
|
|
68
68
|
function paramsToArray(
|
|
69
69
|
sql: string,
|
|
70
|
-
params: QueryParams
|
|
70
|
+
params: QueryParams,
|
|
71
71
|
): { processedSql: string; paramsArray: any } {
|
|
72
72
|
if (typeof sql !== 'string') throw new Error('SQL must be a string');
|
|
73
73
|
if (Array.isArray(params)) {
|
|
@@ -159,7 +159,7 @@ export class PostgresPool {
|
|
|
159
159
|
*/
|
|
160
160
|
async initAsync(
|
|
161
161
|
pgConfig: pg.PoolConfig,
|
|
162
|
-
idleErrorHandler: (error: Error, client: pg.PoolClient) => void
|
|
162
|
+
idleErrorHandler: (error: Error, client: pg.PoolClient) => void,
|
|
163
163
|
): Promise<void> {
|
|
164
164
|
this.pool = new pg.Pool(pgConfig);
|
|
165
165
|
this.pool.on('error', function (err, client) {
|
|
@@ -192,7 +192,7 @@ export class PostgresPool {
|
|
|
192
192
|
} catch (err: any) {
|
|
193
193
|
if (retryCount === retryTimeouts.length) {
|
|
194
194
|
throw new Error(
|
|
195
|
-
`Could not connect to Postgres after ${retryTimeouts.length} attempts: ${err.message}
|
|
195
|
+
`Could not connect to Postgres after ${retryTimeouts.length} attempts: ${err.message}`,
|
|
196
196
|
);
|
|
197
197
|
}
|
|
198
198
|
|
|
@@ -288,7 +288,7 @@ export class PostgresPool {
|
|
|
288
288
|
async queryWithClientAsync(
|
|
289
289
|
client: pg.PoolClient,
|
|
290
290
|
sql: string,
|
|
291
|
-
params: QueryParams
|
|
291
|
+
params: QueryParams,
|
|
292
292
|
): Promise<pg.QueryResult> {
|
|
293
293
|
this._queryCount += 1;
|
|
294
294
|
debug('queryWithClient()', 'sql:', debugString(sql));
|
|
@@ -316,7 +316,7 @@ export class PostgresPool {
|
|
|
316
316
|
async queryWithClientOneRowAsync(
|
|
317
317
|
client: pg.PoolClient,
|
|
318
318
|
sql: string,
|
|
319
|
-
params: QueryParams
|
|
319
|
+
params: QueryParams,
|
|
320
320
|
): Promise<pg.QueryResult> {
|
|
321
321
|
debug('queryWithClientOneRow()', 'sql:', debugString(sql));
|
|
322
322
|
debug('queryWithClientOneRow()', 'params:', debugParams(params));
|
|
@@ -345,7 +345,7 @@ export class PostgresPool {
|
|
|
345
345
|
async queryWithClientZeroOrOneRowAsync(
|
|
346
346
|
client: pg.PoolClient,
|
|
347
347
|
sql: string,
|
|
348
|
-
params: QueryParams
|
|
348
|
+
params: QueryParams,
|
|
349
349
|
): Promise<QueryResult> {
|
|
350
350
|
debug('queryWithClientZeroOrOneRow()', 'sql:', debugString(sql));
|
|
351
351
|
debug('queryWithClientZeroOrOneRow()', 'params:', debugParams(params));
|
|
@@ -395,7 +395,7 @@ export class PostgresPool {
|
|
|
395
395
|
rollbackWithClient(
|
|
396
396
|
client: pg.PoolClient,
|
|
397
397
|
_done: (release?: any) => void,
|
|
398
|
-
callback: (err: Error | null) => void
|
|
398
|
+
callback: (err: Error | null) => void,
|
|
399
399
|
) {
|
|
400
400
|
// Note that we can't use `util.callbackify` here because this function
|
|
401
401
|
// has an additional unused `done` parameter for backwards compatibility.
|
|
@@ -456,7 +456,7 @@ export class PostgresPool {
|
|
|
456
456
|
client: pg.PoolClient,
|
|
457
457
|
_done: (rollback?: any) => void,
|
|
458
458
|
err: Error | null | undefined,
|
|
459
|
-
callback: (error: Error | null) => void
|
|
459
|
+
callback: (error: Error | null) => void,
|
|
460
460
|
): void {
|
|
461
461
|
this.endTransactionAsync(client, err)
|
|
462
462
|
.then(() => callback(null))
|
|
@@ -645,7 +645,7 @@ export class PostgresPool {
|
|
|
645
645
|
async callWithClientAsync(
|
|
646
646
|
client: pg.PoolClient,
|
|
647
647
|
functionName: string,
|
|
648
|
-
params: any[]
|
|
648
|
+
params: any[],
|
|
649
649
|
): Promise<pg.QueryResult> {
|
|
650
650
|
debug('callWithClient()', 'function:', functionName);
|
|
651
651
|
debug('callWithClient()', 'params:', debugParams(params));
|
|
@@ -668,7 +668,7 @@ export class PostgresPool {
|
|
|
668
668
|
async callWithClientOneRowAsync(
|
|
669
669
|
client: pg.PoolClient,
|
|
670
670
|
functionName: string,
|
|
671
|
-
params: any[]
|
|
671
|
+
params: any[],
|
|
672
672
|
): Promise<pg.QueryResult> {
|
|
673
673
|
debug('callWithClientOneRow()', 'function:', functionName);
|
|
674
674
|
debug('callWithClientOneRow()', 'params:', debugParams(params));
|
|
@@ -696,7 +696,7 @@ export class PostgresPool {
|
|
|
696
696
|
async callWithClientZeroOrOneRowAsync(
|
|
697
697
|
client: pg.PoolClient,
|
|
698
698
|
functionName: string,
|
|
699
|
-
params: any[]
|
|
699
|
+
params: any[],
|
|
700
700
|
): Promise<pg.QueryResult> {
|
|
701
701
|
debug('callWithClientZeroOrOneRow()', 'function:', functionName);
|
|
702
702
|
debug('callWithClientZeroOrOneRow()', 'params:', debugParams(params));
|
|
@@ -724,7 +724,7 @@ export class PostgresPool {
|
|
|
724
724
|
async queryValidatedRows<Model extends z.ZodTypeAny>(
|
|
725
725
|
query: string,
|
|
726
726
|
params: QueryParams,
|
|
727
|
-
model: Model
|
|
727
|
+
model: Model,
|
|
728
728
|
): Promise<z.infer<Model>[]> {
|
|
729
729
|
const results = await this.queryAsync(query, params);
|
|
730
730
|
return z.array(model).parse(results.rows);
|
|
@@ -737,7 +737,7 @@ export class PostgresPool {
|
|
|
737
737
|
async queryValidatedOneRow<Model extends z.ZodTypeAny>(
|
|
738
738
|
query: string,
|
|
739
739
|
params: QueryParams,
|
|
740
|
-
model: Model
|
|
740
|
+
model: Model,
|
|
741
741
|
): Promise<z.infer<Model>> {
|
|
742
742
|
const results = await this.queryOneRowAsync(query, params);
|
|
743
743
|
return model.parse(results.rows[0]);
|
|
@@ -750,7 +750,7 @@ export class PostgresPool {
|
|
|
750
750
|
async queryValidatedZeroOrOneRow<Model extends z.ZodTypeAny>(
|
|
751
751
|
query: string,
|
|
752
752
|
params: QueryParams,
|
|
753
|
-
model: Model
|
|
753
|
+
model: Model,
|
|
754
754
|
): Promise<z.infer<Model> | null> {
|
|
755
755
|
const results = await this.queryZeroOrOneRowAsync(query, params);
|
|
756
756
|
if (results.rows.length === 0) {
|
|
@@ -768,7 +768,7 @@ export class PostgresPool {
|
|
|
768
768
|
async queryValidatedSingleColumnRows<Model extends z.ZodTypeAny>(
|
|
769
769
|
query: string,
|
|
770
770
|
params: QueryParams,
|
|
771
|
-
model: Model
|
|
771
|
+
model: Model,
|
|
772
772
|
): Promise<z.infer<Model>[]> {
|
|
773
773
|
const results = await this.queryAsync(query, params);
|
|
774
774
|
if (results.fields.length !== 1) {
|
|
@@ -787,7 +787,7 @@ export class PostgresPool {
|
|
|
787
787
|
async queryValidatedSingleColumnOneRow<Model extends z.ZodTypeAny>(
|
|
788
788
|
query: string,
|
|
789
789
|
params: QueryParams,
|
|
790
|
-
model: Model
|
|
790
|
+
model: Model,
|
|
791
791
|
): Promise<z.infer<Model>> {
|
|
792
792
|
const results = await this.queryOneRowAsync(query, params);
|
|
793
793
|
if (results.fields.length !== 1) {
|
|
@@ -805,7 +805,7 @@ export class PostgresPool {
|
|
|
805
805
|
async queryValidatedSingleColumnZeroOrOneRow<Model extends z.ZodTypeAny>(
|
|
806
806
|
query: string,
|
|
807
807
|
params: QueryParams,
|
|
808
|
-
model: Model
|
|
808
|
+
model: Model,
|
|
809
809
|
): Promise<z.infer<Model> | null> {
|
|
810
810
|
const results = await this.queryZeroOrOneRowAsync(query, params);
|
|
811
811
|
if (results.fields.length !== 1) {
|
|
@@ -826,7 +826,7 @@ export class PostgresPool {
|
|
|
826
826
|
async callValidatedRows<Model extends z.ZodTypeAny>(
|
|
827
827
|
sprocName: string,
|
|
828
828
|
params: any[],
|
|
829
|
-
model: Model
|
|
829
|
+
model: Model,
|
|
830
830
|
): Promise<z.infer<Model>[]> {
|
|
831
831
|
const results = await this.callAsync(sprocName, params);
|
|
832
832
|
return z.array(model).parse(results.rows);
|
|
@@ -839,7 +839,7 @@ export class PostgresPool {
|
|
|
839
839
|
async callValidatedOneRow<Model extends z.ZodTypeAny>(
|
|
840
840
|
sprocName: string,
|
|
841
841
|
params: any[],
|
|
842
|
-
model: Model
|
|
842
|
+
model: Model,
|
|
843
843
|
): Promise<z.infer<Model>> {
|
|
844
844
|
const results = await this.callOneRowAsync(sprocName, params);
|
|
845
845
|
return model.parse(results.rows[0]);
|
|
@@ -852,7 +852,7 @@ export class PostgresPool {
|
|
|
852
852
|
async callValidatedZeroOrOneRow<Model extends z.ZodTypeAny>(
|
|
853
853
|
sprocName: string,
|
|
854
854
|
params: any[],
|
|
855
|
-
model: Model
|
|
855
|
+
model: Model,
|
|
856
856
|
): Promise<z.infer<Model> | null> {
|
|
857
857
|
const results = await this.callZeroOrOneRowAsync(sprocName, params);
|
|
858
858
|
if (results.rows.length === 0) {
|
|
@@ -866,12 +866,12 @@ export class PostgresPool {
|
|
|
866
866
|
async queryRows<Model extends z.ZodTypeAny>(
|
|
867
867
|
sql: string,
|
|
868
868
|
params: QueryParams,
|
|
869
|
-
model: Model
|
|
869
|
+
model: Model,
|
|
870
870
|
): Promise<z.infer<Model>[]>;
|
|
871
871
|
async queryRows<Model extends z.ZodTypeAny>(
|
|
872
872
|
sql: string,
|
|
873
873
|
paramsOrSchema: QueryParams | Model,
|
|
874
|
-
maybeModel?: Model
|
|
874
|
+
maybeModel?: Model,
|
|
875
875
|
) {
|
|
876
876
|
const params = maybeModel === undefined ? {} : (paramsOrSchema as QueryParams);
|
|
877
877
|
const model = maybeModel === undefined ? (paramsOrSchema as Model) : maybeModel;
|
|
@@ -889,12 +889,12 @@ export class PostgresPool {
|
|
|
889
889
|
async queryRow<Model extends z.ZodTypeAny>(
|
|
890
890
|
sql: string,
|
|
891
891
|
params: QueryParams,
|
|
892
|
-
model: Model
|
|
892
|
+
model: Model,
|
|
893
893
|
): Promise<z.infer<Model>>;
|
|
894
894
|
async queryRow<Model extends z.ZodTypeAny>(
|
|
895
895
|
sql: string,
|
|
896
896
|
paramsOrSchema: QueryParams | Model,
|
|
897
|
-
maybeModel?: Model
|
|
897
|
+
maybeModel?: Model,
|
|
898
898
|
) {
|
|
899
899
|
const params = maybeModel === undefined ? {} : (paramsOrSchema as QueryParams);
|
|
900
900
|
const model = maybeModel === undefined ? (paramsOrSchema as Model) : maybeModel;
|
|
@@ -909,17 +909,17 @@ export class PostgresPool {
|
|
|
909
909
|
|
|
910
910
|
async queryOptionalRow<Model extends z.ZodTypeAny>(
|
|
911
911
|
sql: string,
|
|
912
|
-
model: Model
|
|
912
|
+
model: Model,
|
|
913
913
|
): Promise<z.infer<Model> | null>;
|
|
914
914
|
async queryOptionalRow<Model extends z.ZodTypeAny>(
|
|
915
915
|
sql: string,
|
|
916
916
|
params: QueryParams,
|
|
917
|
-
model: Model
|
|
917
|
+
model: Model,
|
|
918
918
|
): Promise<z.infer<Model> | null>;
|
|
919
919
|
async queryOptionalRow<Model extends z.ZodTypeAny>(
|
|
920
920
|
sql: string,
|
|
921
921
|
paramsOrSchema: QueryParams | Model,
|
|
922
|
-
maybeModel?: Model
|
|
922
|
+
maybeModel?: Model,
|
|
923
923
|
) {
|
|
924
924
|
const params = maybeModel === undefined ? {} : (paramsOrSchema as QueryParams);
|
|
925
925
|
const model = maybeModel === undefined ? (paramsOrSchema as Model) : maybeModel;
|
|
@@ -941,7 +941,7 @@ export class PostgresPool {
|
|
|
941
941
|
async queryCursorWithClient(
|
|
942
942
|
client: pg.PoolClient,
|
|
943
943
|
sql: string,
|
|
944
|
-
params: QueryParams
|
|
944
|
+
params: QueryParams,
|
|
945
945
|
): Promise<Cursor> {
|
|
946
946
|
this._queryCount += 1;
|
|
947
947
|
debug('queryCursorWithClient()', 'sql:', debugString(sql));
|
|
@@ -957,7 +957,7 @@ export class PostgresPool {
|
|
|
957
957
|
*/
|
|
958
958
|
async queryCursor<Model extends z.ZodTypeAny>(
|
|
959
959
|
sql: string,
|
|
960
|
-
params: QueryParams
|
|
960
|
+
params: QueryParams,
|
|
961
961
|
): Promise<CursorIterator<z.infer<Model>>> {
|
|
962
962
|
return this.queryValidatedCursorInternal(sql, params);
|
|
963
963
|
}
|
|
@@ -970,7 +970,7 @@ export class PostgresPool {
|
|
|
970
970
|
async queryValidatedCursor<Model extends z.ZodTypeAny>(
|
|
971
971
|
sql: string,
|
|
972
972
|
params: QueryParams,
|
|
973
|
-
model: Model
|
|
973
|
+
model: Model,
|
|
974
974
|
): Promise<CursorIterator<z.infer<Model>>> {
|
|
975
975
|
return this.queryValidatedCursorInternal(sql, params, model);
|
|
976
976
|
}
|
|
@@ -978,7 +978,7 @@ export class PostgresPool {
|
|
|
978
978
|
private async queryValidatedCursorInternal<Model extends z.ZodTypeAny>(
|
|
979
979
|
sql: string,
|
|
980
980
|
params: QueryParams,
|
|
981
|
-
model?: Model
|
|
981
|
+
model?: Model,
|
|
982
982
|
): Promise<CursorIterator<z.infer<Model>>> {
|
|
983
983
|
const client = await this.getClientAsync();
|
|
984
984
|
const cursor = await this.queryCursorWithClient(client, sql, params);
|
package/src/test-utils.ts
CHANGED
|
@@ -37,7 +37,7 @@ async function createDatabase(
|
|
|
37
37
|
database,
|
|
38
38
|
templateDatabase,
|
|
39
39
|
prepare,
|
|
40
|
-
}: CreateDatabaseOptions = {}
|
|
40
|
+
}: CreateDatabaseOptions = {},
|
|
41
41
|
): Promise<void> {
|
|
42
42
|
const client = new pg.Client({
|
|
43
43
|
...getPoolConfig(options),
|
|
@@ -46,7 +46,7 @@ async function createDatabase(
|
|
|
46
46
|
await client.connect();
|
|
47
47
|
|
|
48
48
|
const escapedDatabase = client.escapeIdentifier(
|
|
49
|
-
database ?? getDatabaseNameForCurrentMochaWorker(options.database)
|
|
49
|
+
database ?? getDatabaseNameForCurrentMochaWorker(options.database),
|
|
50
50
|
);
|
|
51
51
|
if (dropExistingDatabase ?? true) {
|
|
52
52
|
await client.query(`DROP DATABASE IF EXISTS ${escapedDatabase}`);
|
|
@@ -76,7 +76,7 @@ async function createDatabase(
|
|
|
76
76
|
},
|
|
77
77
|
(err) => {
|
|
78
78
|
throw err;
|
|
79
|
-
}
|
|
79
|
+
},
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -103,7 +103,7 @@ async function resetDatabase(options: PostgresTestUtilsOptions): Promise<void> {
|
|
|
103
103
|
|
|
104
104
|
async function dropDatabase(
|
|
105
105
|
options: PostgresTestUtilsOptions,
|
|
106
|
-
{ closePool = true, force = false, database }: DropDatabaseOptions = {}
|
|
106
|
+
{ closePool = true, force = false, database }: DropDatabaseOptions = {},
|
|
107
107
|
): Promise<void> {
|
|
108
108
|
if (closePool) {
|
|
109
109
|
await defaultPool.closeAsync();
|