Hi <@U02HXQHCTR8>, is it possible to do `prisma db...
# prisma-data-platform
s
Hi @Austin, is it possible to do
prisma 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:
Copy code
$ 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:
Copy code
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["referentialIntegrity", "dataProxy"]
}

datasource db {
  provider             = "mysql"
  url                  = env("DATABASE_URL")
  referentialIntegrity = "prisma"
}
a
Hey SJ, I discussed this same issue in a different thread not too long ago. The Data Proxy URL doesn’t yet support Prisma Migrate, so you will need to use your regular database connection string when using the migrate commands. We recommend setting up NPM scripts to simplify this.
Copy code
// package.json
{
  ...,
  "scripts": {
    "generate-client": "PRISMA_CLIENT_ENGINE_TYPE='dataproxy' prisma generate",
    "migrate": "DATABASE_URL=\"$MIGRATE_DATABASE_URL\" prisma migrate deploy",
    ...
  }
}
s
Thanks! I saw Chris' and your thread, but I thought you meant that
prisma 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 🙂
🚀 1