Failed to initialize database adapter

I'm currently running the Drizzle adapter, and currently cannot get it to generate a schema.

The following auth.ts causes the cli to throw:
Failed to initalize database adapter
export const auth = betterAuth({
  database: drizzleAdapter(db, {
    provider: "pg",
    schema: { // Throws with or without this
      ...schema,
    },
  }),
});

The database is currently the following:
import { drizzle } from "drizzle-orm/node-postgres";
import { loadEnvConfig } from "@next/env";

// Load environment variables
loadEnvConfig(process.cwd());

export const db = drizzle(process.env.DATABASE_URL!);

When using the following base for betterAuth it successfully tells me:
✔ Your schema is already up to date.
export const auth = betterAuth({
  database: new Pool({
    connectionString: process.env.DATABASE_URL,
  }),
});
Was this page helpful?