Closed kringt06 closed 4 years ago
Hi, thank you for raising this issue!
This would indeed be better to allow to pass --schema when generating tenants. I'll try to work on this feature request, and implement it for the next release of prisma-multi-tenant (probably this week end)
The --schema
has been implemented and released in prisma-multi-tenant@2.3.1
runLocal Error:
const sharedPath = await findUp('node_modules/@prisma-multi-tenant/shared/build')
// return => sharedPath = undefined
Lead to
Unknown Error!
Error: Command failed: node "/Users/xxx/node_modules/@prisma/cli/build/index.js" generate
Environment variables loaded from prisma/.env
Error: Either provide --schema or make sure that you are in a folder with a schema.prisma file.
What command where you running ? Does @prisma-multi-tenant/shared is present in your node_modules ? (It should be a dependency of @prisma-multi-tenant/client)
RUN npm run gen
....... package.json scripts => npx prisma-multi-tenant generate --schema=\"./prisma/one.prisma\"
"dependencies": {
"prisma-multi-tenant": "2.3.1",
"@prisma-multi-tenant/client": "2.3.1",
"@prisma-multi-tenant/shared": "2.3.1"
}
There are ‘< project >/node_modules/@prisma-multi-tenant/shared ’
Can you try removing "npx" in the npm script ?
Error again!
Unfortunately, I am not able to reproduce. Can you make a small reproduction repository so that I can take a look?
I think the problem may be related to the pnpm install
.
I've adjusted the dependencies, and that's OK.
But you might want to look at why is the pnpm
problematic.
https://github.com/364734461/pmt-test
RUN examples/prisma-cli-404 -> npm run generate -> will Error: Cannot find @prisma/cli
RUN examples/pmt -> npm run generate -> will Error: Command failed: node "/Users/xxx/pmt-test/examples/pmt/node_modules/@prisma/cli/build/index.js" generate Environment variables loaded from prisma/.env Error: Either provide --schema or make sure that you are in a folder with a schema.prisma file.
Great to hear it's working for you.
Yes, it looks like pnpm is doing something that prisma-multi-tenant isn't built to handle. I'll probably look at how Prisma handled this
Now I want to pass through
prisma generate --schema="***"
to implement custom directories. (schema.prisma)But....code....
You can open the parameters?
like this
....