PrismaP
Prisma2w ago
2 replies
augie

Multi-database project with separate Prisma schemas - "model already exists" errors

I have a project that connects to 3 separate SQL Server databases, each with its own independent Prisma schema:
prisma/
  db-one/
    schema.prisma      # → generates to src/generated/prisma/db-one-client
    prisma.config.ts   # uses DB_ONE_URL
  db-two/
    schema.prisma      # → generates to src/generated/prisma/db-two-client
    prisma.config.ts   # uses DB_TWO_URL
  db-three/
    schema.prisma      # → generates to src/generated/prisma/db-three-client
    prisma.config.ts   # uses DB_THREE_URL

The CLI works perfectly - prisma db pull --schema=prisma/db-one/schema.prisma --config=prisma/db-one/prisma.config.ts both work correctly for all three schemas.

However, the Prisma VS Code extension shows errors like:

* The generator "client" cannot be defined because a generator with that name already exists.

Each schema has its own generator client block (with different output paths), but the extension seems to be merging all schemas together instead of treating them as independent.

Is there a way to configure the Prisma extension to understand these are independent schemas? Or is this a known limitation? The false positives are noisy but I can live with them if there's no fix.

Using Prisma 7.2.0, Cursor on Windows, Extension prisma.prisma v31.3.4
Was this page helpful?