[GH-ISSUE #8185] Add support for expression builder in adapter.update #19648

Open
opened 2026-04-15 18:56:05 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @hindmost on GitHub (Feb 27, 2026).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/8185

Is this suited for github?

  • Yes, this is suited for github

Is your feature request related to a problem? Please describe.

Currently adapter.update only supports Record object in update option, which is unsuitable for atomic updates like UPDATE table SET column = column + $1

Describe the solution you'd like

Add support for expression builder like in Kysely's UpdateQueryBuilder.set()

Describe alternatives you've considered

Giving back context.db property in plugin endpoints could solve this problem.
The only alternative I can see is keep a separate Kysely instance for such tasks.

Additional context

No response

Originally created by @hindmost on GitHub (Feb 27, 2026). Original GitHub issue: https://github.com/better-auth/better-auth/issues/8185 ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. Currently `adapter.update` only supports `Record` object in `update` option, which is unsuitable for atomic updates like `UPDATE table SET column = column + $1` ### Describe the solution you'd like Add support for expression builder like in Kysely's [`UpdateQueryBuilder.set()`](https://kysely-org.github.io/kysely-apidoc/classes/UpdateQueryBuilder.html#set) ### Describe alternatives you've considered Giving back `context.db` property in plugin endpoints could solve this problem. The only alternative I can see is keep a separate Kysely instance for such tasks. ### Additional context _No response_
GiteaMirror added the database label 2026-04-15 18:56:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#19648