[GH-ISSUE #2017] Generate Kysely migration as typescript #17638

Closed
opened 2026-04-15 15:50:04 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @gdaybrice on GitHub (Mar 27, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/2017

Is this suited for github?

  • Yes, this is suited for github

No response

Describe the solution you'd like

I propose adding support for generating Kysely migrations in TypeScript format. This would allow developers to maintain type-safe database schema changes under version control, while leveraging Kysely's migration API for better TypeScript integration.

Describe alternatives you've considered

Currently, BetterAuth migrations either generates raw SQL migrations or applies changes directly to the database without proper version control.

Additional context

No response

Originally created by @gdaybrice on GitHub (Mar 27, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/2017 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. _No response_ ### Describe the solution you'd like I propose adding support for generating Kysely migrations in TypeScript format. This would allow developers to maintain type-safe database schema changes under version control, while leveraging Kysely's migration API for better TypeScript integration. ### Describe alternatives you've considered Currently, BetterAuth migrations either generates raw SQL migrations or applies changes directly to the database without proper version control. ### Additional context _No response_
GiteaMirror added the enhancementlocked labels 2026-04-15 15:50:04 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 26, 2025):

Hi, @gdaybrice. I'm Dosu, and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale.

Issue Summary

  • Proposal to enhance BetterAuth by adding support for generating Kysely migrations in TypeScript.
  • Aims to improve type safety and version control for database schema changes.
  • Current system generates raw SQL or applies changes directly, lacking proper version control.
  • Suggests utilizing Kysely's migration API for better TypeScript integration.
  • No comments or further activity since the issue was opened.

Next Steps

  • Please confirm if this issue is still relevant to the latest version of the better-auth repository by commenting here.
  • If there is no response, the issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

<!-- gh-comment-id:3008996479 --> @dosubot[bot] commented on GitHub (Jun 26, 2025): Hi, @gdaybrice. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog. I'm marking this issue as stale. **Issue Summary** - Proposal to enhance BetterAuth by adding support for generating Kysely migrations in TypeScript. - Aims to improve type safety and version control for database schema changes. - Current system generates raw SQL or applies changes directly, lacking proper version control. - Suggests utilizing Kysely's migration API for better TypeScript integration. - No comments or further activity since the issue was opened. **Next Steps** - Please confirm if this issue is still relevant to the latest version of the better-auth repository by commenting here. - If there is no response, the issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Author
Owner

@pspeter3 commented on GitHub (Sep 25, 2025):

I understand this issue is stale but I think that this would be a good feature to support. What would it take to re-open it?

<!-- gh-comment-id:3335039419 --> @pspeter3 commented on GitHub (Sep 25, 2025): I understand this issue is stale but I think that this would be a good feature to support. What would it take to re-open it?
Author
Owner

@gdaybrice commented on GitHub (Oct 19, 2025):

Let's reopen this one!

<!-- gh-comment-id:3419988706 --> @gdaybrice commented on GitHub (Oct 19, 2025): Let's reopen this one!
Author
Owner

@dosubot[bot] commented on GitHub (Oct 19, 2025):

@Bekacru The user gdaybrice has indicated that the issue is still relevant and requests a new version since they cannot reopen the closed issue. Could you please assist with this?

<!-- gh-comment-id:3419990089 --> @dosubot[bot] commented on GitHub (Oct 19, 2025): @Bekacru The user gdaybrice has indicated that the issue is still relevant and requests a new version since they cannot reopen the closed issue. Could you please assist with this?
Author
Owner

@ping-maxwell commented on GitHub (Oct 24, 2025):

I think that if more people want this then it can make sense, so for anyone reading this, please upvote the original post to indicate a want for this feature.

Right now I think that introduces a lot of maintenance work for something that isn't as necessary. Being able to generate SQL is enough to compare changes across version control.
Having this idea would mean that we need to maintain both the existing kysely migration system as well as generating typescript code which runs the kysely migration too. Generating code can get really error prone and makes new contributions towards the library regarding databases related changes more difficult. Along with other issues to consider.

I'm against this idea for those reasons, however if enough people want this than it can be considered.

<!-- gh-comment-id:3441572024 --> @ping-maxwell commented on GitHub (Oct 24, 2025): I think that if more people want this then it can make sense, so for anyone reading this, please upvote the original post to indicate a want for this feature. Right now I think that introduces a lot of maintenance work for something that isn't as necessary. Being able to generate SQL is enough to compare changes across version control. Having this idea would mean that we need to maintain both the existing kysely migration system as well as generating typescript code which runs the kysely migration too. Generating code can get really error prone and makes new contributions towards the library regarding databases related changes more difficult. Along with other issues to consider. I'm against this idea for those reasons, however if enough people want this than it can be considered.
Author
Owner

@pspeter3 commented on GitHub (Oct 24, 2025):

I think it’s a question of parity with Drizzle and Prisma.

<!-- gh-comment-id:3442766753 --> @pspeter3 commented on GitHub (Oct 24, 2025): I think it’s a question of parity with Drizzle and Prisma.
Author
Owner

@montanaflynn commented on GitHub (Dec 4, 2025):

We want to adopt kysely but having some of the tables outside of the kysely migration files doesn't sound great.

<!-- gh-comment-id:3612930340 --> @montanaflynn commented on GitHub (Dec 4, 2025): We want to adopt kysely but having some of the tables outside of the kysely migration files doesn't sound great.
Author
Owner

@dosubot[bot] commented on GitHub (Mar 5, 2026):

Hi, @gdaybrice. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You requested support for generating Kysely migrations in TypeScript to enable type-safe, version-controlled schema changes.
  • Current migrations rely on raw SQL or direct application without version control.
  • Community members like pspeter3 and montanaflynn have expressed support for this feature to match tools like Drizzle and Prisma.
  • The maintainer ping-maxwell raised concerns about increased maintenance burden and complexity, indicating the feature would be considered only with significant demand.
  • The issue has gathered some upvotes but remains unresolved.

Next Steps:

  • Please let me know if this feature is still relevant to your needs with the latest version of better-auth by commenting on this issue.
  • If I do not hear back within 7 days, the issue will be automatically closed.

Thank you for your understanding and contribution!

<!-- gh-comment-id:4006190056 --> @dosubot[bot] commented on GitHub (Mar 5, 2026): Hi, @gdaybrice. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You requested support for generating Kysely migrations in TypeScript to enable type-safe, version-controlled schema changes. - Current migrations rely on raw SQL or direct application without version control. - Community members like pspeter3 and montanaflynn have expressed support for this feature to match tools like Drizzle and Prisma. - The maintainer ping-maxwell raised concerns about increased maintenance burden and complexity, indicating the feature would be considered only with significant demand. - The issue has gathered some upvotes but remains unresolved. **Next Steps:** - Please let me know if this feature is still relevant to your needs with the latest version of better-auth by commenting on this issue. - If I do not hear back within 7 days, the issue will be automatically closed. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#17638