ydb-nodejs-sdk icon indicating copy to clipboard operation
ydb-nodejs-sdk copied to clipboard

feat: add support for using keyword

Open polRk opened this issue 1 year ago • 3 comments

Pull request type

Please check one the type of change your PR introduces:

  • [ ] Bugfix
  • [x] Feature
  • [ ] Code style update (formatting, renaming)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] Documentation content changes
  • [ ] Other (please describe):

What does it do?

Adds disposable support

Why is it needed?

Closes #353

How to test it?

{
   await using driver = new Driver()
}
// driver destroyed

Related issue(s)/PR(s)

#353

polRk avatar Aug 14 '24 06:08 polRk

Hi! I have attempted to do some basic test - https://github.com/ydb-platform/ydb-nodejs-sdk/blob/feat/add-support-using/src/tests/e2e/using-keyword.test.ts and received the following error:

TypeError: Symbol.asyncDispose is not defined.|

Seems that something is still missing to start using 'using'

Zork33 avatar Aug 21 '24 08:08 Zork33

TypeError: Symbol.asyncDispose is not defined.

Hi! Please, provide information about your runtime.

polRk avatar Sep 10 '24 12:09 polRk

@Zork33 I think, the problem is about your runtime (maybe needs extra compile step)

❯ bun test src/__tests__/e2e/using-keyword.test.ts
bun test v1.1.21 (70ca2b76)

src/__tests__/e2e/using-keyword.test.ts:
Works

polRk avatar Oct 08 '24 14:10 polRk