[PR #7316] [MERGED] feat(cli): generate schema from adapter CLI flag #15468

Closed
opened 2026-04-13 10:02:45 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7316
Author: @ping-maxwell
Created: 1/13/2026
Status: Merged
Merged: 2/28/2026
Merged by: @Bekacru

Base: canaryHead: feat/cli/schema-gen-via-adapter-flag


📝 Commits (10+)

  • 4bf19df feat(cli): generate schema from adapter CLI flag
  • 970ee6b init
  • 6904ed1 Update packages/cli/src/commands/generate.ts
  • 0e364ba Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag
  • d3e767e Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag
  • 274dccd Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag
  • 3a92fe8 Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag
  • fe3b4fc Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag
  • e02a586 Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag
  • 14dbeaf Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag

📊 Changes

2 files changed (+523 additions, -4 deletions)

View changed files

📝 packages/cli/src/commands/generate.ts (+80 -4)
📝 packages/cli/test/generate.test.ts (+443 -0)

📄 Description

Allows for --adapter <drizzle|prisma|etc> & --dialect <sqlite|postgresql|etc>


Summary by cubic

Add --adapter and --dialect flags to the CLI generate command so you can generate schemas without a configured database. This speeds up bootstrapping and makes CI setups simpler.

  • New Features
    • --adapter <prisma|drizzle|kysely> to select the generator.
    • --dialect <postgresql|mysql|sqlite|...>; for drizzle, postgresql maps to pg.
    • Creates a mock adapter when flags are used, so no DB connection is required.
    • Falls back to the configured adapter when flags aren’t provided.

Written for commit e02a58635d. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7316 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 1/13/2026 **Status:** ✅ Merged **Merged:** 2/28/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `feat/cli/schema-gen-via-adapter-flag` --- ### 📝 Commits (10+) - [`4bf19df`](https://github.com/better-auth/better-auth/commit/4bf19df1d59cabbfaa5a9a77164d6d398c01dd59) feat(cli): generate schema from adapter CLI flag - [`970ee6b`](https://github.com/better-auth/better-auth/commit/970ee6b9a2948aa1e8e798f605c43bf6a5204a00) init - [`6904ed1`](https://github.com/better-auth/better-auth/commit/6904ed117dfeb3bbe5343c2e9e57291cd7eadea5) Update packages/cli/src/commands/generate.ts - [`0e364ba`](https://github.com/better-auth/better-auth/commit/0e364bac23c1be5118731a368a95ec2b83064e18) Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag - [`d3e767e`](https://github.com/better-auth/better-auth/commit/d3e767e169c39ef811adeac557a5002c0177e5c0) Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag - [`274dccd`](https://github.com/better-auth/better-auth/commit/274dccd5389d18b9435efd4a6384a82db5a64a2b) Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag - [`3a92fe8`](https://github.com/better-auth/better-auth/commit/3a92fe8891bdb79d440e7c2952ee90f240e2a5f9) Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag - [`fe3b4fc`](https://github.com/better-auth/better-auth/commit/fe3b4fc58b3094a55056276423b2a82a4595c553) Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag - [`e02a586`](https://github.com/better-auth/better-auth/commit/e02a58635dee068af2c4e4ed82ff5c4fe18ff3f5) Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag - [`14dbeaf`](https://github.com/better-auth/better-auth/commit/14dbeafe32e5bc734e4571d6e5f5343d29c5553e) Merge branch 'canary' into feat/cli/schema-gen-via-adapter-flag ### 📊 Changes **2 files changed** (+523 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/cli/src/commands/generate.ts` (+80 -4) 📝 `packages/cli/test/generate.test.ts` (+443 -0) </details> ### 📄 Description Allows for `--adapter <drizzle|prisma|etc>` & `--dialect <sqlite|postgresql|etc>` <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Add --adapter and --dialect flags to the CLI generate command so you can generate schemas without a configured database. This speeds up bootstrapping and makes CI setups simpler. - **New Features** - --adapter <prisma|drizzle|kysely> to select the generator. - --dialect <postgresql|mysql|sqlite|...>; for drizzle, postgresql maps to pg. - Creates a mock adapter when flags are used, so no DB connection is required. - Falls back to the configured adapter when flags aren’t provided. <sup>Written for commit e02a58635dee068af2c4e4ed82ff5c4fe18ff3f5. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 10:02:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#15468