Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

await using kysely = new Kysely() support. #1167

Merged
merged 4 commits into from
Oct 19, 2024

Conversation

igalklebanov
Copy link
Member

@igalklebanov igalklebanov commented Oct 3, 2024

Hey 👋

This PR introduces await using db = new Kysely(...) support. Under the hood, it calls the destroy function when the scope in which using was used is exited.

using is part of TypeScript since version 5.2 was released in August 2023 (more than a year ago).

According to npm stats:

typescript has 59,208,821 weekly downloads.

typescript@5.6.2 has 10,367,140 weekly downloads.
typescript@5.5.4 has 5,269,636 weekly downloads.
typescript@5.5.3 has 1,986,815 weekly downloads.
typescript@5.5.2 has 793,512 weekly downloads.
typescript@5.4.5 has 4,832,241 weekly downloads.
typescript@5.4.4 has 272,520 weekly downloads.
typescript@5.4.3 has 551,093 weekly downloads.
typescript@5.4.2 has 1,258,707 weekly downloads.
typescript@5.3.3 has 4,330,332 weekly downloads.
typescript@5.3.2 has 429,380 weekly downloads.
typescript@5.2.2 has 8,388,969 weekly downloads.

total of 38,480,345 (64.99%)

Copy link

vercel bot commented Oct 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
kysely ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 19, 2024 1:30pm

@igalklebanov igalklebanov added enhancement New feature or request api Related to library's API labels Oct 3, 2024
@igalklebanov igalklebanov added the typescript Related to Typescript label Oct 3, 2024
@igalklebanov igalklebanov changed the title using kysely = new Kysely() support. await using kysely = new Kysely() support. Oct 3, 2024
Comment on lines +37 to +46
// @ts-ignore
Symbol.asyncDispose ??= Symbol('Symbol.asyncDispose')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@igalklebanov igalklebanov merged commit 66c0e57 into kysely-org:v0.28 Oct 19, 2024
12 checks passed
@igalklebanov igalklebanov deleted the ts-using branch October 19, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to library's API enhancement New feature or request typescript Related to Typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant