I’m using the prisma data proxy in testing and pro...
# prisma-data-platform
g
I’m using the prisma data proxy in testing and production, but on local I use my local DB. when i add
previewFeatures = ["dataProxy"]
to my schema.prisma, I get the following error
InvalidDatasourceError: Datasource URL should use prisma:// protocol
. How do I turn off dataProxy for local dev?
n
Hey there šŸ‘‹ you might need to remove (or just comment out) the
previewFeatures = ["dataProxy"]
line in local development. Are you using env vars to configure your DB connection?
m
ā˜šŸ¼ You should use env vars in your configuration: • If you use
engineType = "dataproxy"
in your schema, set a shell env var instead: ā—¦
PRISMA_CLIENT_ENGINE_TYPE=library
for regular prisma client ā—¦
PRISMA_CLIENT_ENGINE_TYPE=dataproxy
for the data proxy client • If you have an URL that is har-coded in the schema, use an env var in the schema: ā—¦
url = env("DATA_PROXY_URL")
šŸ’Æ 2
To make it more convenient, you can have two
.env
files, one for pro and one for dev.
šŸ‘ 1