Export using internal adapter #2424

Closed
opened 2026-03-13 09:53:16 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @vikto132 on GitHub (Nov 30, 2025).

Is this suited for github?

  • Yes, this is suited for github

My project using postgresql as database. I need to implement soft delete when user want to delete these account and holding for some time before hard delete the data. I have successfully implemented the feature with by copy entire internal Kyle adapter using some minor change.

Describe the solution you'd like

I just hope if you guy can export internal adapter so we can reuse it and override some of it method it. This will really help when we want to upgrade lib version in the future, cuz I only want do some minor adjustments to the adapter but now I have to create and maintain entire new custom adapter.

Describe alternatives you've considered

allow override some of adapter method in database options

Additional context

No response

Originally created by @vikto132 on GitHub (Nov 30, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. My project using postgresql as database. I need to implement soft delete when user want to delete these account and holding for some time before hard delete the data. I have successfully implemented the feature with by copy entire internal Kyle adapter using some minor change. ### Describe the solution you'd like I just hope if you guy can export internal adapter so we can reuse it and override some of it method it. This will really help when we want to upgrade lib version in the future, cuz I only want do some minor adjustments to the adapter but now I have to create and maintain entire new custom adapter. ### Describe alternatives you've considered allow override some of adapter method in database options ### Additional context _No response_
GiteaMirror added the adapter label 2026-03-13 09:53:16 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Nov 30, 2025):

(tag @better-auth-agent if you would like an answer from the Agent)

DiagramDiscordGitHub

Diagram Join Star

@better-auth-agent[bot] commented on GitHub (Nov 30, 2025): (tag @better-auth-agent if you would like an answer from the Agent) <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) • [Discord](https://discord.gg/better-auth) • [GitHub](https://github.com/better-auth/better-auth) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/better-auth_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/better-auth) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/better-auth/better-auth)
Author
Owner

@vikto132 commented on GitHub (Dec 7, 2025):

@better-auth-agent

@vikto132 commented on GitHub (Dec 7, 2025): @better-auth-agent
Author
Owner

@better-auth-agent[bot] commented on GitHub (Dec 7, 2025):

Thanks for reaching out! I understand you’d like to have the internal adapter exported so you can easily override specific methods (such as those for soft delete) without maintaining an entire custom adapter. Currently, the adapter is used internally to handle database operations (e.g., creating or updating users/sessions) and is not exposed for direct override. Your suggestion to allow overriding selected methods via configuration or an exported adapter is a valuable enhancement and aligns with our goal of making customization easier for developers [1].

We recommend opening a feature request on our GitHub repository (if you haven’t already) so that the team can evaluate this proposal. In the meantime, have you considered wrapping or extending the current adapter logic via plugins to apply your soft-delete adjustments? This might serve as a temporary workaround until the internal adapter is officially exportable.

Tag @better-auth-agent if you would like an answer from the Agent. What additional customization would be most useful for you in this process?

DiagramDiscordGitHub

Diagram Join Star

@better-auth-agent[bot] commented on GitHub (Dec 7, 2025): Thanks for reaching out! I understand you’d like to have the internal adapter exported so you can easily override specific methods (such as those for soft delete) without maintaining an entire custom adapter. Currently, the adapter is used internally to handle database operations (e.g., creating or updating users/sessions) and is not exposed for direct override. Your suggestion to allow overriding selected methods via configuration or an exported adapter is a valuable enhancement and aligns with our goal of making customization easier for developers [[1]](https://github.com/better-auth/better-auth/issues/6446). We recommend opening a feature request on our GitHub repository (if you haven’t already) so that the team can evaluate this proposal. In the meantime, have you considered wrapping or extending the current adapter logic via plugins to apply your soft-delete adjustments? This might serve as a temporary workaround until the internal adapter is officially exportable. Tag @better-auth-agent if you would like an answer from the Agent. What additional customization would be most useful for you in this process? <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) • [Discord](https://discord.gg/fG2XXEuQX3) • [GitHub](https://github.com/Skyvern-AI/Skyvern) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/fG2XXEuQX3) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/Skyvern-AI/Skyvern)
Author
Owner

@ping-maxwell commented on GitHub (Jan 10, 2026):

You can already access the internal adapter right off your auth instance:

export const ctx = await auth.$context;
export const internalAdapter = ctx.internalAdapter;
@ping-maxwell commented on GitHub (Jan 10, 2026): You can already access the internal adapter right off your auth instance: ```ts export const ctx = await auth.$context; export const internalAdapter = ctx.internalAdapter; ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#2424