createSchema method being ignored when creating custom adapter #1159

Closed
opened 2026-03-13 08:25:36 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @er1chi on GitHub (May 5, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. create basic betterAuth config
  2. Follow documented steps to creating a custom adapter
  3. run pnpm dlx @better-auth/cli generate

Current vs. Expected behavior

Expected: provided createSchema method to be utilized from customAdapter

Bug: cli's generate command and subsequently getGenerator method fails when providing custom id/adapter. getGenerator looks in the following adapters object which will always fail for previously mentioned case

export const adapters = {
	prisma: generatePrismaSchema,
	drizzle: generateDrizzleSchema,
	kysely: generateMigrations,
};

results in 'custom-adapter' is not supported error

What version of Better Auth are you using?

1.2.8-beta.1

Provide environment information

- Mac

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

Backend

Auth config (if applicable)

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

Additional context

using 1.2.8-beta.1 to resolve type errors as changes from PR 2398 weren't pushed to npm registry I believe? Not sure how that works exactly

Originally created by @er1chi on GitHub (May 5, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### To Reproduce 1. create basic `betterAuth` config 2. Follow documented steps to creating a custom adapter 3. run `pnpm dlx @better-auth/cli generate` ### Current vs. Expected behavior Expected: provided `createSchema` method to be utilized from `customAdapter` Bug: cli's `generate` command and subsequently `getGenerator` method fails when providing custom id/adapter. `getGenerator` looks in the following `adapters` object which will always fail for previously mentioned case ```ts export const adapters = { prisma: generatePrismaSchema, drizzle: generateDrizzleSchema, kysely: generateMigrations, }; ``` results in `'custom-adapter' is not supported` error ### What version of Better Auth are you using? 1.2.8-beta.1 ### Provide environment information ```bash - Mac ``` ### Which area(s) are affected? (Select all that apply) Backend ### Auth config (if applicable) ```typescript import { betterAuth } from "better-auth" export const auth = betterAuth({ emailAndPassword: { enabled: true }, database: customAdapter(cfg) }); ``` ### Additional context using 1.2.8-beta.1 to resolve type errors as changes from PR 2398 weren't pushed to npm registry I believe? Not sure how that works exactly
Author
Owner

@dosubot[bot] commented on GitHub (Aug 4, 2025):

Hi, @0xcire. I'm Dosu, and I'm helping the better-auth team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that in Better Auth v1.2.8-beta.1, the createSchema method in your custom adapter is ignored when running the generate CLI command.
  • The root cause is that the getGenerator function only recognizes built-in adapters, causing a "custom-adapter is not supported" error.
  • This prevents the CLI from using your custom adapter's schema generation as intended.
  • There has been no further activity or comments on this issue since it was opened.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of better-auth by commenting here to keep the discussion open.
  • If I do not hear back within 7 days, I will automatically close this issue.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 4, 2025): Hi, @0xcire. I'm [Dosu](https://dosu.dev), and I'm helping the better-auth team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that in Better Auth v1.2.8-beta.1, the `createSchema` method in your custom adapter is ignored when running the `generate` CLI command. - The root cause is that the `getGenerator` function only recognizes built-in adapters, causing a "custom-adapter is not supported" error. - This prevents the CLI from using your custom adapter's schema generation as intended. - There has been no further activity or comments on this issue since it was opened. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of better-auth by commenting here to keep the discussion open. - If I do not hear back within 7 days, I will automatically close this issue. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#1159