[GH-ISSUE #3291] Add support for directly using the postgres.js library #18188

Closed
opened 2026-04-15 16:34:28 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @k3dom on GitHub (Jul 7, 2025).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/3291

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

Currently for postgres I can only pass a node-postgres pool as a configuration, but not a postgres.js connection. It would be nice to directly support this library aswell because I currently need to unnecessarily wrap my postgres.js connection in a drizzle object so I can then use the drizzleAdapter.

Current vs. Expected behavior

Here is what I want:

import postgres from 'postgres'
import { betterAuth } from 'better-auth'

const sql = postgres({ /* options */ })
const auth = betterAuth({ database: sql, /* options */ })

What version of Better Auth are you using?

^1.2.12

Provide environment information

- OS: Linux

Which area(s) are affected? (Select all that apply)

Backend, Package

Auth config (if applicable)

import { betterAuth } from "better-auth"
export const auth = betterAuth({
  emailAndPassword: {  
    enabled: true
  },
});

Additional context

No response

Originally created by @k3dom on GitHub (Jul 7, 2025). Original GitHub issue: https://github.com/better-auth/better-auth/issues/3291 ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce Currently for postgres I can only pass a `node-postgres` pool as a configuration, but not a `postgres.js` connection. It would be nice to directly support this library aswell because I currently need to unnecessarily wrap my `postgres.js` connection in a drizzle object so I can then use the `drizzleAdapter`. ### Current vs. Expected behavior Here is what I want: ```ts import postgres from 'postgres' import { betterAuth } from 'better-auth' const sql = postgres({ /* options */ }) const auth = betterAuth({ database: sql, /* options */ }) ``` ### What version of Better Auth are you using? ^1.2.12 ### Provide environment information ```bash - OS: Linux ``` ### Which area(s) are affected? (Select all that apply) Backend, Package ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, }); ``` ### Additional context _No response_
GiteaMirror added the enhancement label 2026-04-15 16:34:28 -05:00
Author
Owner

@ping-maxwell commented on GitHub (Aug 11, 2025):

Under the hood we use Kysely (an ORM), so unfortunately if Kysely doesn't support it than we don't support it.
Given that Kysely is an ORM it's essentially no different than using Drizzle (in the sense that you're using an ORM anyway) maybe besides stuff like setting up schemas.

I'll be closing this issue, if you would like postgres.js support please open an issue in the Kysely github

<!-- gh-comment-id:3176701889 --> @ping-maxwell commented on GitHub (Aug 11, 2025): Under the hood we use Kysely (an ORM), so unfortunately if Kysely doesn't support it than we don't support it. Given that Kysely is an ORM it's essentially no different than using Drizzle (in the sense that you're using an ORM anyway) maybe besides stuff like setting up schemas. I'll be closing this issue, if you would like postgres.js support please open an issue in the [Kysely github](https://github.com/kysely-org/kysely)
Author
Owner

@Damato commented on GitHub (Mar 31, 2026):

Under the hood we use Kysely (an ORM), so unfortunately if Kysely doesn't support it than we don't support it. Given that Kysely is an ORM it's essentially no different than using Drizzle (in the sense that you're using an ORM anyway) maybe besides stuff like setting up schemas.

I'll be closing this issue, if you would like postgres.js support please open an issue in the Kysely github

This sadly makes BetterAuth it incompatible with CloudFlare pages, among others.

<!-- gh-comment-id:4163938874 --> @Damato commented on GitHub (Mar 31, 2026): > Under the hood we use Kysely (an ORM), so unfortunately if Kysely doesn't support it than we don't support it. Given that Kysely is an ORM it's essentially no different than using Drizzle (in the sense that you're using an ORM anyway) maybe besides stuff like setting up schemas. > > I'll be closing this issue, if you would like postgres.js support please open an issue in the [Kysely github](https://github.com/kysely-org/kysely) This sadly makes BetterAuth it incompatible with CloudFlare pages, among others.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#18188