Error connecting fly pg app to Prisma in a separate app

I am having trouble with deployment. I have tried using the flycast.internal url string for the DATABASE_URL in my .env file (for prisma to use) but it doesn’t seem to be working.

The Fly pg app is already connected to the other fly app which contains and uses prisma. So does anyone know how or what URL string I should be using in this scenario?

Thanks for any help!

Hi… The DATABASE_URL typically contains a password, so you generally want to keep it in the secrets vault, instead of in a .env file. The default format for the URL is…

postgres://<user>:<password>@db-app-name.flycast:5432/<database_name>?sslmode=disable

If you wanted to have a separate set of tables for the new app—and just avoid the expense and inconvenience of provisioning a second Postgres machine—then you would use fly pg attach. That command would create a fresh DATABASE_URL and add it into your new app’s secrets automatically.