SJ
04/18/2022, 4:12 PMprisma db push
with only the prisma://...
URL as the datasource.db
, and using PRISMA_CLIENT_ENGINE_TYPE=dataproxy
?
Asking, because I'm getting the following error:
$ prisma db push
Error: Get config: Schema Parsing P1012
error: Error validating datasource `db`: the URL must start with the protocol `mysql://`.
I'm assuming the correct use case is, that I'd need to use the mysql://
URL locally (because TCP works in local dev environments anyway), and then I may use the prisma://
URL in prod (e.g. in a serverless environment, because generally only HTTP connections are allowed there)
Full config:
generator client {
provider = "prisma-client-js"
previewFeatures = ["referentialIntegrity", "dataProxy"]
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
referentialIntegrity = "prisma"
}
Austin
04/18/2022, 4:18 PM// package.json
{
...,
"scripts": {
"generate-client": "PRISMA_CLIENT_ENGINE_TYPE='dataproxy' prisma generate",
"migrate": "DATABASE_URL=\"$MIGRATE_DATABASE_URL\" prisma migrate deploy",
...
}
}
SJ
04/18/2022, 4:22 PMprisma db migrate
couldn't use the dataproxy, but it's clear to me now that the whole prisma db ...
family of commands doesn't work yet with the dataproxy
All clear now, thanks again 🙂