Navigation Menu

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

Can I generate prisma-client-py with the Node prisma CLI? #159

Closed
janpio opened this issue Dec 3, 2021 · 6 comments · Fixed by #164
Closed

Can I generate prisma-client-py with the Node prisma CLI? #159

janpio opened this issue Dec 3, 2021 · 6 comments · Fixed by #164
Labels
kind/question Developer asked a question. No code changes required.

Comments

@janpio
Copy link

janpio commented Dec 3, 2021

Is there a way to use npx prisma generate to generate the Python client instead of using the package CLI via pip with pip install -U prisma?

@RobertCraigie
Copy link
Owner

RobertCraigie commented Dec 3, 2021

It should be possible to generate the python client using npx prisma generate without any extra setup, does it not work for you?

It should be noted that you will have to pip install prisma first but there is nothing python specific in the packaged CLI.

For additional context the prisma-client-py provider value is a shell script alias for python -m prisma.

@RobertCraigie RobertCraigie added the kind/question Developer asked a question. No code changes required. label Dec 3, 2021
@janpio
Copy link
Author

janpio commented Dec 3, 2021

I honestly did not try (as I have no pip locally) but only read the docs where this option was not documented.

@RobertCraigie
Copy link
Owner

Ah okay, I should explicitly document that then, it should work in theory and I think I've tried it in the past with success.

@janpio
Copy link
Author

janpio commented Dec 3, 2021

Considering that the pip installed CLI can not run the JS Client generation, I think that might be a valid use case (while we try to figure that out and fix it).

@RobertCraigie
Copy link
Owner

I forgot that I explicitly check the prisma version before generating, this does make it more difficult to use the Node CLI to generate the Python client but it's still possible, you just have to explicitly pass the version if the Python Client is not on the latest version, e.g.

npx prisma@3.4.0 generate

I will also improve the version check error message to include the aforementioned fix.

@RobertCraigie
Copy link
Owner

However, I did encounter prisma/prisma#10573 while testing which makes the above workaround more difficult to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Developer asked a question. No code changes required.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants