Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute Prisma commands from the project dir #2404

Open
sodic opened this issue Dec 9, 2024 · 3 comments
Open

Execute Prisma commands from the project dir #2404

sodic opened this issue Dec 9, 2024 · 3 comments
Labels

Comments

@sodic
Copy link
Contributor

sodic commented Dec 9, 2024

Reported in version: 0.15.2


We execute Prisma commands from the generated server dir (.wasp/out/server). We do this to ensure Prisma correctly picks up our env vars: #1662.

Running Prisma from the server dir causes unexpected behavior (often because different stuff gets installed in different node_modules folders).

We should solve the env variable issue and find a way run all commands from the project's root directory.

Important

The command for generating the Prisma client is also run from .wasp/out/server, but the client is generated in the correct location (top-level node_modules). I guess this is because our SDK (wasp package) lists it as a dependency.

If that's true, it's very implicit and flaky, and we should fix that too.

@sodic sodic added the prisma label Dec 9, 2024
@infomiho
Copy link
Contributor

infomiho commented Dec 9, 2024

I'd love it if we could go full vanilla with Prisma.

The biggest blocker is our injected auth models. If we could maybe find a way to inject it via some Prisma plugin / generator thing - that would make it work for us. And then, Wasp just runs Prisma commands with much intervention, everything lives in the user-land and everyone is happier.

I know this is maybe out of scope for this issue, but I wanted to voice this somewhere :)

@Martinsos
Copy link
Member

Hm yeah, more vanilla we go, the less we interfere and possibly stop people from using some features. But, we also should think a bit upfront about Full Stack Modules -> they might again need us to have more control over Prisma schema hm.

@sodic
Copy link
Contributor Author

sodic commented Dec 21, 2024

I met @jkomyno at Armada JS and, if I understood him correctly, the next version of Prisma will no longer require relations to have a relation field on each model.

@infomiho Does that help with injected auth models?

@jkomyno Feel free to correct me if I misunderstood something :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants