Repository navigation
Description
Feature Summary
Add support glob patterns in schema option for prismaSchemaFolder
Use Cases & Problem Description
We are using multiple databases based on the Prisma guide. In doing so, we want to keep the structure as modular as possible, and we would like to distinguish schemas corresponding to different databases by their file extensions, like this:
/
└─ src
└─ modules
├─ module-a
│ ├─ db
│ │ ├─ module-a.database-1.prisma
│ │ └─ module-a.database-2.prisma
│ ├─ graphql
│ │ └─ module-a.graphql
│ └─ ...
├─ module-b
│ ├─ db
│ │ ├─ module-b.database-1.prisma
│ │ └─ module-b.database-1.prisma
│ ├─ graphql
│ │ └─ module-b.graphql
│ └─ ...
└─ ...
Currently, the schema option in prismaSchemaFolder only accepts either a file or a directory, so this method cannot be used.
import { defineConfig } from "prisma/config";
export default defineConfig({
earlyAccess: true,
// It unintentionally includes both database-1.prisma and database-2.prisma.
schema: "./src/modules",
});Proposed Solution
I would like the schema option to support glob patterns.
import { defineConfig } from "prisma/config";
export default defineConfig({
earlyAccess: true,
schema: "./src/modules/**/*.database-1.prisma",
});Alternative Solutions
There is a tool called prisma-import that allowed us to look up appropriate files using glob patterns, and we had been using it even before prismaSchemaFolder was introduced. However, since prisma-import is no longer maintained, it would be great if similar functionality could be supported in prismaSchemaFolder.
Potential Considerations
No response
Prisma Version
6.6.0
What part of Prisma does this affect?
Prisma Schema
Additional Context
I have found that the logic for fetching schemas is located here, so I believe I could also submit a PR myself if necessary: https://github.com/prisma/prisma/blob/main/packages/internals/src/cli/getSchema.ts
Pre-Submission Checklist
- I have searched existing issues to make sure this is not a duplicate
- I have checked the Prisma roadmap to see if this is already planned
- I have described why this belongs in Prisma Core rather than a solution in application code
Activity
Euregan commentedon Nov 20, 2026
Same need here. We're on Prisma 6 with MongoDB, planning a gradual move to Postgres. Our .prisma files live next to each domain's code, so both schemas will share one source tree during the move. A folder path picks up every .prisma file, so today the only option is a copy step before generate.
I'd like to implement this. Docs too, if that's in scope for a patch.
I know 6 isn't on the supported versions list anymore. Would you accept this and publish it as a 6.19.x release?