fdarian/prisma-generator-drizzle

Circular dependency on generated schema

fdarian opened this issue · 3 comments

Simply separate all definitions into a single module

This issue raised from these comments:
#1 (comment)
#1 (comment)

Doing it rn

Hi @octalpixel, I just added the PR to properly fix the circular dependencies. Could you please confirm by using 0.5.4-9955142 resolves the issue?

Regarding your solutions:

Have a flag to output everything to one file. (Fixes the require cycle for React Native projects)

I think It'd be an extra work to sort the const definitions whoever should be declared first or later. Also it should be better for the editor's performance

Have a flag to output relationship to another file

This PR will make that as the default

Flag to only generate relationships (This can actually be a good starting point to learn about how to make relationships with Drizzle as well)

The main focus currently is to use Drizzle from Prisma schema — a drop-in replacement for their prisma client engine. However please feel free to raise an issue describing the motivation and examples to see how many people upvote this.

Will check this out! Thanks for the addressing this