You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are using the Go client in addition to another client or if you use npx prisma generate to generate the Go client, you might run into a version mismatch. This happens due to the fact that the Prisma NodeJS CLI version differs than what is shipped in the Go client.
To fix this, you need to either make sure the version is the same, or use the Go command to generate the Go client.
The difference
npm / prisma-client-js
npx prisma generate
Using this command to generate the Go client might result in a version mismatch.
go command
go run github.com/steebchen/prisma-client-go generate
This command is consistent as the Prisma version is defined in your go.mod file.
The command and the actual generator is guaranteed to be the same version, because the Go client ships with the Prisma CLI.
If you are using 2 generators
If you currently use two generators, such as prisma-client-js and the Go client, you have two options. You can either make sure the Prisma CLI version matches the Prisma Go client CLI version, or you can use the go command to generate the Go client, and the JS command to generate the JS client separately.
a) Make sure the version matches
Run these:
npx prisma version
# and
go run github.com/steebchen/prisma-client-go version
If the version mismatches, find a Go client release that uses the Prisma version, or change your Prisma version in your package.json to match the Go client Prisma version.
b) Use the Go command
Alternatively, you can use the Go command to generate your Prisma version, regardless of what version you are using for the JS client.
If you currently have two generators in your schema.prisma file, you need to change it to one and dynamically change the generator.
generatorclient {provider=env("GENERATOR_PROVIDER")// optionally provide more configuration optionsoutput=env("GENERATOR_OUTPUT")}
And then run as follows:
GENERATOR_PROVIDER="go run github.com/steebchen/prisma-client-go" go run github.com/steebchen/prisma-client-go
# or
GENERATOR_PROVIDER="prisma-client-js" npx prisma generate
The text was updated successfully, but these errors were encountered:
steebchen
changed the title
Version mismatch
Prisma CLI version mismatch
Nov 11, 2023
If you are using the Go client in addition to another client or if you use
npx prisma generate
to generate the Go client, you might run into a version mismatch. This happens due to the fact that the Prisma NodeJS CLI version differs than what is shipped in the Go client.To fix this, you need to either make sure the version is the same, or use the Go command to generate the Go client.
The difference
npm / prisma-client-js
Using this command to generate the Go client might result in a version mismatch.
go command
This command is consistent as the Prisma version is defined in your go.mod file.
The command and the actual generator is guaranteed to be the same version, because the Go client ships with the Prisma CLI.
If you are using 2 generators
If you currently use two generators, such as prisma-client-js and the Go client, you have two options. You can either make sure the Prisma CLI version matches the Prisma Go client CLI version, or you can use the go command to generate the Go client, and the JS command to generate the JS client separately.
a) Make sure the version matches
Run these:
npx prisma version # and go run github.com/steebchen/prisma-client-go version
If the version mismatches, find a Go client release that uses the Prisma version, or change your Prisma version in your package.json to match the Go client Prisma version.
b) Use the Go command
Alternatively, you can use the Go command to generate your Prisma version, regardless of what version you are using for the JS client.
If you currently have two generators in your schema.prisma file, you need to change it to one and dynamically change the generator.
Change this:
To this:
And then run as follows:
The text was updated successfully, but these errors were encountered: