# Viewing data (/docs/guides/postgres/viewing-data)

> For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL.

Viewing and editing data in Prisma Postgres via Prisma Studio or other database GUIs

Location: Guides > Postgres > Viewing data

You can view and edit your data in Prisma Postgres using either [Prisma Studio](https://www.prisma.io/docs/studio) or 3rd party database editors.

## Viewing and editing data in Prisma Studio [#viewing-and-editing-data-in-prisma-studio]

With Prisma Postgres, a hosted version of Prisma Studio is available in your project. In your project environment in the [Platform Console](https://console.prisma.io/?utm_source=docs\&utm_medium=content\&utm_content=guides), select the **Studio** tab in the left-hand navigation to view and edit your data:

<img alt="View of Prisma Studio open in the console." src="/img/ppg-studio.png" width="3248" height="2112" />

You can also run Prisma Studio locally by running:

  

#### bun

```bash
bunx prisma studio
```

#### pnpm

```bash
pnpm dlx prisma studio
```

#### yarn

```bash
yarn dlx prisma studio
```

#### npm

```bash
npx prisma studio
```

This should start a live server in `http://localhost:5555` where you can visit and interact with your database.

If your database is managed with [Prisma Next](https://www.prisma.io/docs/orm/next), Studio also shows a **Migrations** view alongside your tables, with a visual diff of what each applied migration changed. See [Studio with Prisma Next](https://www.prisma.io/docs/studio/prisma-next).

## Connecting to Prisma Postgres instance with 3rd party database editors [#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](https://www.npmjs.com/package/@prisma/ppg-tunnel). See the example below to connect using TablePlus.

### 1. Create a TCP tunnel to access Prisma Postgres directly [#1-create-a-tcp-tunnel-to-access-prisma-postgres-directly]

If you already have a `.env` file in your current directory with `DATABASE_URL` set, the tunnel CLI will automatically pick it up, no need to manually export it. However, if you haven't set up a `.env` file, you'll need to set the `DATABASE_URL` environment variable explicitly.

In your terminal, to 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 connection string value for your Prisma Postgres instance):

  

#### macOS

```bash
export DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=API_KEY"
```

#### Linux

```bash
export DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=API_KEY"
```

#### Windows

```cmd
set "DATABASE_URL=prisma+postgres://accelerate.prisma-data.net/?api_key=API_KEY"
```

> [!NOTE]
> If you explicitly set `DATABASE_URL` in your terminal, that value will take precedence over the one in your `.env` file.

Run the following command to connect to your Prisma Postgres instance via `@prisma/ppg-tunnel` package:

  

#### bun

```bash
bunx @prisma/ppg-tunnel --host 127.0.0.1 --port 52604
```

#### pnpm

```bash
pnpm dlx @prisma/ppg-tunnel --host 127.0.0.1 --port 52604
```

#### yarn

```bash
yarn dlx @prisma/ppg-tunnel --host 127.0.0.1 --port 52604
```

#### npm

```bash
npx @prisma/ppg-tunnel --host 127.0.0.1 --port 52604
```

```text wrap
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.

### 2a. Connect to Prisma Postgres using TablePlus [#2a-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:

1. Open TablePlus and click on the **+** icon to add a new connection.
2. Select **PostgreSQL** as the database type.
3. 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.
4. Click on **Connect** to connect to your Prisma Postgres instance.

<img alt="View of TablePlus connected to Prisma Postgres via tunnel" src="/img/ppg-tableplus.png" width="996" height="778" />

### 2b. Connect to Prisma Postgres using DataGrip [#2b-connect-to-prisma-postgres-using-datagrip]

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 DataGrip:

1. Open DataGrip and click on the **+** icon and select "Datasource".
2. Select **PostgreSQL** as the database type.
3. 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 keep this field empty.
   * **Password**: This will be ignored due to the tunnel, you can keep this field empty.
   * **URL**: In the URL append the following query parameter `?sslmode=disable` to the end of the URL.
4. Click on **Test Connection** to ensure that DataGrip can connect to your Prisma Postgres instance. Once successful, click **OK** to save the connection.

<img alt="View of DataGrip connected to Prisma Postgres via tunnel" src="/img/ppg-datagrip.png" width="1076" height="1346" />

### 2c. Connect to Prisma Postgres using DBeaver [#2c-connect-to-prisma-postgres-using-dbeaver]

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 DBeaver:

1. Open DBeaver and click on the **New Database Connection** button or **File** > **New** to add a new connection.
2. Select **PostgreSQL** as the database type.
3. Select **URL** option in Connect by section.
4. Enter the URL in this format:
   * **URL**: Your URL should be in this format: `jdbc:postgresql://localhost:52604/postgres?sslmode=disable`. Here make sure that you enter the port number you obtained from the output of the `@prisma/ppg-tunnel` package. In this case, the port number is `52604`. There is no need to enter Username or Password as authentication is manged by Tunnel.
5. Click on **Test Connection** to ensure that DBeaver can connect to your Prisma Postgres instance. If successful, click **Finish**.

<img alt="View of DBeaver connected to Prisma Postgres via tunnel" src="/img/ppg-dbeaver.png" width="1612" height="1364" />

### 2d. Connect to Prisma Postgres using Postico [#2d-connect-to-prisma-postgres-using-postico]

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 Postico:

1. Open Postico and click on the **New Server** button to add a new connection.
2. 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 keep this field empty.
   * **Password**: This will be ignored due to the tunnel, you can keep this field empty.
3. Check "Pre-Connect Shell Script" and enter:
   ```sh
   cat <<eof
   {
   "sslmode":"disable",
   }
   eof
   ```
4. Click on **Test Connection** to ensure that Postico can connect to your Prisma Postgres instance. If successful, click **Connect**.

<img alt="View of Postico connected to Prisma Postgres via tunnel" src="/img/ppg-postico.png" width="430" height="508" />

## Related pages

- [`Firebase Studio`](https://www.prisma.io/docs/guides/postgres/idx): Learn how to use Prisma Postgres in the online Firebase Studio
- [`Fly.io`](https://www.prisma.io/docs/guides/postgres/flyio): Learn how to deploy applications using Prisma Postgres to Fly.io
- [`Netlify`](https://www.prisma.io/docs/guides/postgres/netlify): Learn how to create Prisma Postgres databases via the official Netlify extension and deploy your applications with it
- [`Vercel`](https://www.prisma.io/docs/guides/postgres/vercel): Learn how to create Prisma Postgres databases via the Vercel Marketplace and deploy your Next.js, Nuxt, and SvelteKit applications.
- [`VS Code`](https://www.prisma.io/docs/guides/postgres/vscode): The Prisma VS Code extension provides a management UI for Prisma Postgres and superpowers for Copilot agent mode