W
Wasp2d ago
jason

How do I access Prisma Studio for my Wasp app that I've deployed on Fly.io?

Hi all, like the title asks, how can I access the Prisma Studio to view / modify database records for a Wasp app that's been deployed to Fly.io?
1 Reply
kapa.ai
kapa.ai2d ago
Hi @jason. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To access Prisma Studio for your Wasp app deployed on Fly.io, you'll need to follow these steps: 1. Open a tunnel to your Fly.io database using the following command:
fly proxy 5432 -a <db-name>

fly proxy 5432 -a <db-name>

Replace <db-name> with your Fly.io database app name. 2. In a new terminal tab, set the DATABASE_URL environment variable to connect to your production database. You'll need to use the database credentials you received when first deploying your app to Fly.io. The format should be:
DATABASE_URL=postgres://<user>:<pw>@localhost:5432/<db_name>?sslmode=disable

DATABASE_URL=postgres://<user>:<pw>@localhost:5432/<db_name>?sslmode=disable

3. Once the tunnel is open and you've set the DATABASE_URL, you can run Prisma Studio using the Wasp CLI command:
wasp db studio

wasp db studio

This should open Prisma Studio in your browser, connected to your production database. Important notes: - Be cautious when interacting with your production database, as any changes you make will affect your live app. - After you're done, remember to close the tunnel and remove the DATABASE_URL from your local environment to avoid accidentally connecting to the production database later. These steps are based on information from Github Issue #1464 and a Discord support thread. If you encounter any issues or need more detailed instructions, please let me know. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @jason, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?

Did you find this page helpful?