Tooling
You can view and edit your data in Prisma Postgres using either Prisma Studio or 3rd party database editors.
Viewing and editing data in Prisma Studio
With Prisma Postgres, a hosted version of Prisma Studio is available for you in of your project. In your project environment in the , select the Studio tab in the left-hand navigation to view and edit your data:
You can also run Prisma Studio locally by running:
npx prisma studio
This should start a live server in http://localhost:5555
where you can visit and interact with your database.
Connecting to Prisma Postgres instance with 3rd party database editors
You can connect to your Prisma Postgres instance using third party database editors like pgAdmin, TablePlus, Postico etc using @prisma/ppg-tunnel
package. See the example below to connect using TablePlus.
1. Create a TCP tunnel to access Prisma Postgres directly
In your terminal, set the environment variable DATABASE_URL
referring to your Prisma Postgres instance which you want to connect to (be sure to replace the API_KEY
placeholder with the API key value of your Prisma Postgres instance):
- macOS
- Linux
- Windows
export DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=API_KEY"
export DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=API_KEY"
set DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=API_KEY"
Run the following command to connect to your Prisma Postgres instance via @prisma/ppg-tunnel
package:
npx @prisma/ppg-tunnel --host 127.0.0.1 --port 52604
Prisma Postgres auth proxy listening on 127.0.0.1:52604 🚀
Your connection is authenticated using your Prisma Postgres API key.
...
==============================
hostname: 127.0.0.1
port: 52604
username: <anything>
password: <none>
==============================
Copy the port
from the output above, you will need it in the next step.
Keep this tunnel process running while you are using the database editor to maintain the connection.
2. Connect to Prisma Postgres using TablePlus
Based on the database editor you are using, you can connect to your Prisma Postgres instance using the details you obtained from the output of the @prisma/ppg-tunnel
package. To add the connection string in TablePlus:
- Open TablePlus and click on the + icon to add a new connection.
- Select PostgreSQL as the database type.
- Enter the following details:
- Name: Any name you want to give to your connection.
- Host:
127.0.0.1
in this case. - Port: The
port
number you obtained from the output of the@prisma/ppg-tunnel
package. - User: This will be ignored due to the tunnel, you can provide any value here.
- Password: This will be ignored due to the tunnel, you can provide any value here.
- Click on Connect to connect to your Prisma Postgres instance.