Select the directory of where to generate the client?
See original GitHub issueProblem
Consider two directories:
- shared
- project
My schema.prisma resides in the shared
directory. There is also a package.json
in the shared directory. I am trying to generate a client in the project
directory from the schema.prisma file.
If i cd
to project
and do npx prisma generate --schema=../shared/prisma.schema
then the client is built in shared
, and not in project
like I wanted.
Suggested solution
Add a flag to specify working directory of the generate
command. Use the working directory to generate the client, only use the --schema
flag to read the file but ignore it when deciding where to put the client.
Alternatives
(None)
Additional context
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Generating the client (Concepts) - Prisma
By default, Prisma Client is generated into the node_modules/.prisma/client folder, but you can specify a custom location. To generate and instantiate Prisma ...
Read more >Making the code directory available to all thin client ... - IBM
On the code server, start Windows Explorer. · Select the directory on the code server that will be used to serve thin client...
Read more >Create a directory of names, addresses, and other information
Go to Mailings > Start Mail Merge > Directory. Select recipients.
Read more >ASP.Net Web Application Choose Client Side Directory
I have the requirement to allow a user to provide a local directory path via a UI in a web application so ...
Read more >Selecting a public Outlook folder for client email
Note: If your firm is running Practice CS in a Virtual Office CS or Software as a Service (SaaS) environment, you cannot create...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks a lot for helping me out here!
It did work with mutple generators blocks, but I am now using a slightly different workaround as it suits our project better, using an env variable that I set before I invoke
prisma generate
:That way, I can do
to generate the client for my
myproject
directory.However I don’t think this is perfect, because the “shared” folder (under which the
schema.prisma
file resides) will then get its own set of packages innode_modules
. And they are never used unless I do anotherprisma generate
.Personally I find it somewhat un-intuitive that
prisma generate
is using only the schema file location to determine where the client should be built. Would it not be more “normal” to use the current directory? Other cli tools I’ve ever encountered (e.g npm, protoc, gradle, tar) emit files at the current directory. So in comparison I wanted the client to be built at/home/birger/someweirddir
I would either have to door use a flag (if the tool has one).
TL;DR, the workaround is fine but I think others might also find that they want to manually override where
prisma generate
emits its files.I think we have the same problem? Look here : #13164