datasource db {
// could be postgresql or mysql
provider = "sqlite"
url = "file:dev.db"
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["jsonProtocol", "views"]
}
generator db {
provider = "go run github.com/steebchen/prisma-client-go"
}
model Post {
id String @default(cuid()) @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String
published Boolean
desc String?
}
However, I get error
{"level":"fatal","error":"request failed: http status code 422 with response {\"is_panic\":false,\"message\":\"Error parsing Json query. data did not match any variant of untagged enum JsonBody\",\"backtrace\":null}","time":"2023-06-17T14:04:38-04:00","message":"Could not connect to Prisma."}
Removing the jsonProtocol from JS client works, as does generating the clients one at a time (e.g. commenting out the JS generator with jsonProtocol enabled).
Minimally reproducible example -- take quickstart and add a JS generator. See https://github.com/steebchen/prisma-client-go/issues/877, but you can generate with
npx prisma db push
and then rungo run main.go
However, I get error
Removing the
jsonProtocol
from JS client works, as does generating the clients one at a time (e.g. commenting out the JS generator withjsonProtocol
enabled).