database: new Pool
Has anyone manged to get the setup working with pg Pool? I've tried to use the generate cli tool or make tables manually but i keep getting an error:
2025-02-27T20:06:39.772Z ERROR [Better Auth]: Better auth was unable to query your database.
Error: [error: relation "user" does not exist] {
It doesn't tell me anything where the relation is missing.
I moved from Prismaadapter to basic postgresql, deleted all the tables and changed my auth.ts to use:
database: new Pool({
connectionString: process.env.DATABASE_URL,
}),
and
tables: {
user: "users",
account: "account",
session: "session",
verification: "verification"
},

1 Reply
the migration file tries to create "user" table but you can't create "user" table in postgresql so it fails
it doesn't seem like it respects the remapping to:
tables: {
user: "users",
account: "account",
session: "session",
verification: "verification"
},