From 5d3ecb0de7d017ba13cefa15379ac8f1bc454877 Mon Sep 17 00:00:00 2001 From: Vladislav Polyakov Date: Wed, 14 Aug 2024 09:04:10 +0300 Subject: [PATCH] feat: add support for using keyword --- src/discovery/discovery-service.ts | 4 ++++ src/driver.ts | 7 +++---- src/schema/scheme-client.ts | 4 ++++ src/table/table-client.ts | 4 ++++ tsconfig-cjs.json | 1 + tsconfig-esm.json | 1 + tsconfig.json | 1 + 7 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/discovery/discovery-service.ts b/src/discovery/discovery-service.ts index 89e348f0..c73ea8a6 100644 --- a/src/discovery/discovery-service.ts +++ b/src/discovery/discovery-service.ts @@ -148,4 +148,8 @@ export default class DiscoveryService extends AuthenticatedService { await this.pool.destroy(ctx); } + + async [Symbol.asyncDispose]() { + return this.destroy(); + } } diff --git a/tsconfig-cjs.json b/tsconfig-cjs.json index 57618278..7b5c494c 100644 --- a/tsconfig-cjs.json +++ b/tsconfig-cjs.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig-base.json", "compilerOptions": { + "lib": ["ES2022","ESNext.Disposable"], "target": "es2017", "module": "commonjs", "outDir": "build/cjs" diff --git a/tsconfig-esm.json b/tsconfig-esm.json index 2cedbf4e..778fff02 100644 --- a/tsconfig-esm.json +++ b/tsconfig-esm.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig-base.json", "compilerOptions": { + "lib": ["ES2022","ESNext.Disposable"], "module": "commonjs", "outDir": "build/esm", "target": "esnext" diff --git a/tsconfig.json b/tsconfig.json index 57618278..7b5c494c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig-base.json", "compilerOptions": { + "lib": ["ES2022","ESNext.Disposable"], "target": "es2017", "module": "commonjs", "outDir": "build/cjs"