---
title: Browse a PostgreSQL database
project: Code
version: 2.0
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/code/2-0/guides/db-viewer/
updated: 2026-11-19T04:32:04.377Z
---

# Browse a PostgreSQL database

> Open the DB viewer from a connection string in your code.

The DB viewer opens a PostgreSQL database in a window of the editor.

## Who can use it

Administrators can always open it. For other people, an administrator checks **Allow to open DB viewer** in the [user form](../manage-users/).

## Open the viewer

**1.** Open the file that holds the connection, for example `config`. The line must have a name in front of the address:

```text
database : postgresql://user:password@localhost:5432/database
```

**2.** Select the whole line.

**3.** Right-click the selection and choose **Open DB viewer**.

## Run a query

The window has a box for your query.

1. Type the SQL query.
2. Click **Run query**, or press `Ctrl+Enter` (`Cmd+Enter` on macOS).

**History** lists your earlier queries, **Options** offers ready-made SQL, and **Search in results** filters the rows you see.

A query runs as soon as you start it, and the viewer doesn't ask you to confirm. Take extra care with queries that change or delete data.
