Add support for expression builder in adapter.update #2930

Open
opened 2026-03-13 10:28:11 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @hindmost on GitHub (Feb 27, 2026).

Is this suited for github?

  • Yes, this is suited for github

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). ### 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 enhancement label 2026-03-13 10:28:11 -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#2930