advanced.generateId: false is ignored in 1.2.6 with drizzleAdapter

Hi everyone,

After updating to v1.2.6, I've encountered a problem where better-auth is generating IDs, which conflicts with my database that relies on UUIDs. The issue seems most likely related to the drizzleAdapter, as similar problems appeared with the passkey and emailOTP plugins.

I temporarily downgraded to v1.2.5 to avoid the error, which looks like this:

# SERVER_ERROR:  [error: invalid input syntax for type uuid: "whFaJpiOdr2ppkZD4lOP19hsh08acoT2"] {
  length: 164,
  severity: 'ERROR',
  code: '22P02',
  ...,
  routine: 'string_to_uuid'
}


To reproduce:
Install better-auth@1.2.6 and use the following auth configuration (note that the issue is likely with drizzleAdapter):

export const auth = betterAuth({
  appName: process.env.NAME,
  database: drizzleAdapter(db, {
    provider: "pg",
    schema: schema
  }),
  advanced: {
    generateId: false,
  },
  emailAndPassword: {
    enabled: true,
    password: {
      verify: async (data) => true  // For easier debugging
    }
  },
  plugins: [
    passkey({
      rpID: process.env.RP_ID,
      rpName: process.env.NAME,
      origin: process.env.ORIGIN,
    }),
    emailOTP({
      sendVerificationOnSignUp: false,
      disableSignUp: true,
      async sendVerificationOTP({ email, otp, type }) { /* ... */ },
    }),
    nextCookies()
  ],
});


Any guidance or fixes would be greatly appreciated.

Thanks,
Rémi
Solution
okay try disabling auto generated Ids by setting advanced.database.generateId to false
Was this page helpful?