Bun: Failed to initialize database adapter

Hi, I'm using buns SQL with kysely-postgres-js' dialect like so:
export const db = new Kysely<Database>({
  dialect: new PostgresJSDialect({
    postgres: new SQL(process.env.DATABASE_URL!, { adapter: "postgres" }),
  }),
});

// in lib/auth.ts
import { db } from "../clients";

export const auth = betterAuth({
  database: db,
  // ...
});


Hitting a error:
Server error: 990 |   if (typeof options.database === "function") {
991 |     return options.database(options);
992 |   }
993 |   const { kysely, databaseType, transaction } = await createKyselyAdapter(options);
994 |   if (!kysely) {
995 |     throw new BetterAuthError("Failed to initialize database adapter");
                    ^
BetterAuthError: Failed to initialize database adapter
 cause: undefined,


Is this not supported? Do I have to bring in pg for example?
Was this page helpful?