[PR #7195] fix(cli): generate prisma schema without datasource blocks #24036

Open
opened 2026-04-15 22:08:28 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7195
Author: @ping-maxwell
Created: 1/8/2026
Status: 🔄 Open

Base: mainHead: fix/cli/generate-prisma-schema-without-datasource-blocks


📝 Commits (8)

  • fe5251b fix(cli): generate prisma schema without datasource blocks
  • 43cbeae Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks
  • 1570fdd Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks
  • fdb949a Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks
  • 4f41629 Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks
  • 7a505fe Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks
  • d87cfd9 Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks
  • 6a19891 Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks

📊 Changes

5 files changed (+217 additions, -16 deletions)

View changed files

📝 docs/content/docs/adapters/prisma.mdx (+17 -1)
📝 packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts (+9 -0)
📝 packages/cli/src/generators/prisma.ts (+24 -15)
packages/cli/test/__snapshots__/schema-skip-generator-datasource.prisma (+80 -0)
📝 packages/cli/test/generate.test.ts (+87 -0)

📄 Description

closes https://github.com/better-auth/better-auth/issues/7139

This PR adds a new prisma config option called skipGeneratorAndDatasource and it allows the better-auth CLI to generate a Prisma schema file without including the datasource & generator blocks.


Summary by cubic

Adds a new Prisma adapter option to let the CLI generate a schema without generator and datasource blocks. This is useful when those blocks are managed elsewhere.

  • New Features
    • Added Prisma config option: skipGeneratorAndDatasource (default false).
    • CLI skips creating/updating generator and datasource blocks, including the Prisma v7 generator provider change, when enabled.
    • Updated docs with usage example and added tests, including a snapshot for the skip-enabled path.

Written for commit 6a1989107f. 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/7195 **Author:** [@ping-maxwell](https://github.com/ping-maxwell) **Created:** 1/8/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/cli/generate-prisma-schema-without-datasource-blocks` --- ### 📝 Commits (8) - [`fe5251b`](https://github.com/better-auth/better-auth/commit/fe5251beae5fd3c221569893b76a2d9ef8607a78) fix(cli): generate prisma schema without datasource blocks - [`43cbeae`](https://github.com/better-auth/better-auth/commit/43cbeaedea6ff22d857cddc79ecc99f2d4bc7002) Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks - [`1570fdd`](https://github.com/better-auth/better-auth/commit/1570fdd158ff7720dea8a7a72d6f7439afe605cd) Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks - [`fdb949a`](https://github.com/better-auth/better-auth/commit/fdb949aa733bf93af2a373d42aeade368a481182) Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks - [`4f41629`](https://github.com/better-auth/better-auth/commit/4f41629134fc50fcb62e101efe1ac3bcdbe25a30) Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks - [`7a505fe`](https://github.com/better-auth/better-auth/commit/7a505feb627f0fda818b4996176ea25df89f3d98) Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks - [`d87cfd9`](https://github.com/better-auth/better-auth/commit/d87cfd906243ff328c1427888392f5f8e665b1c0) Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks - [`6a19891`](https://github.com/better-auth/better-auth/commit/6a1989107f33805ebd2f269f36c184f9f58e2508) Merge branch 'canary' into fix/cli/generate-prisma-schema-without-datasource-blocks ### 📊 Changes **5 files changed** (+217 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/adapters/prisma.mdx` (+17 -1) 📝 `packages/better-auth/src/adapters/prisma-adapter/prisma-adapter.ts` (+9 -0) 📝 `packages/cli/src/generators/prisma.ts` (+24 -15) ➕ `packages/cli/test/__snapshots__/schema-skip-generator-datasource.prisma` (+80 -0) 📝 `packages/cli/test/generate.test.ts` (+87 -0) </details> ### 📄 Description closes https://github.com/better-auth/better-auth/issues/7139 This PR adds a new prisma config option called `skipGeneratorAndDatasource` and it allows the better-auth CLI to generate a Prisma schema file without including the `datasource` & `generator` blocks. <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds a new Prisma adapter option to let the CLI generate a schema without generator and datasource blocks. This is useful when those blocks are managed elsewhere. - **New Features** - Added Prisma config option: skipGeneratorAndDatasource (default false). - CLI skips creating/updating generator and datasource blocks, including the Prisma v7 generator provider change, when enabled. - Updated docs with usage example and added tests, including a snapshot for the skip-enabled path. <sup>Written for commit 6a1989107f33805ebd2f269f36c184f9f58e2508. 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-15 22:08:28 -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#24036