prisma-dbml-generator icon indicating copy to clipboard operation
prisma-dbml-generator copied to clipboard

Feature Request: Multi-Schema Support

Open albertilagan opened this issue 2 years ago • 5 comments

Seems like Prisma's multiSchema previewFeature does not work with the latest version (0.10.0).

Are we waiting for it to be on GA? or is this something we can implement already?

albertilagan avatar Dec 29 '22 14:12 albertilagan

Hi @albertilagan, we don't need to wait for multiSchema to hit GA. If you like you could create a PR to support this feature.

Things to consider:

  1. Does Prisma surface multiSchema information in the DMMF? (clone this project and comment in https://github.com/notiz-dev/prisma-dbml-generator/blob/main/src/cli/dbml-generator.ts#L26 to receive a DMMF file and run npm run dev)
  2. How does schema look like in the DBML?

marcjulian avatar Jan 02 '23 09:01 marcjulian

Hi @albertilagan, we don't need to wait for multiSchema to hit GA. If you like you could create a PR to support this feature.

Things to consider:

  1. Does Prisma surface multiSchema information in the DMMF? (clone this project and comment in https://github.com/notiz-dev/prisma-dbml-generator/blob/main/src/cli/dbml-generator.ts#L26 to receive a DMMF file and run npm run dev)
  2. How does schema look like in the DBML?

Hi, @marcjulian just saw this, and upon checking looks like the schema value is not yet exposed on DMMF. Will wait for Prisma, or maybe I'll create a PR there as well when I have the time :)

albertilagan avatar Jan 17 '23 22:01 albertilagan

Hi @albertilagan, we don't need to wait for multiSchema to hit GA. If you like you could create a PR to support this feature.

Things to consider:

  1. Does Prisma surface multiSchema information in the DMMF? (clone this project and comment in https://github.com/notiz-dev/prisma-dbml-generator/blob/main/src/cli/dbml-generator.ts#L26 to receive a DMMF file and run npm run dev)
  2. How does schema look like in the DBML?

Can't wait for Prisma so I just bruteforce my way into it. multiSchema Support

Definitely not the best way to implement this but this works for us for now.

albertilagan avatar Jan 18 '23 20:01 albertilagan

I'm looking at the DMMF in Prisma 6.5.0 uncommenting the lines mentioned above and I see the schema. So I guess this feature is now possible?

I'll take a crack at it.

kevb avatar Mar 21 '25 17:03 kevb

Here's my fork with a Cursor one-shot attempt (which works for me - I think) - https://github.com/kevb/prisma-dbml-generator

But now can anyone help answer a question... the DBML looks right (schema.table) but when I paste it at dbdiagram.io it doesn't render the groupings. Am I missing something, is it a paid feature? I'm sure I saw it working somewhere but now I can't find it.

Cheers!

kevb avatar Mar 21 '25 18:03 kevb