---
title: "db test"
description: "Test database connection"
canonical: "https://pgbeam.com/docs/cli/db/test"
last-updated: "2026-10-30T03:14:55.000Z"
---

# db test

> Test database connection

URL: https://pgbeam.com/docs/cli/db/test

{/* Auto-generated from CLI commands. Do not edit. Run `pnpm generate:cli-docs` to regenerate. */}

Attempts to connect to the upstream database using the stored credentials and returns the result.

## Usage

```bash
pgbeam db test <id>
```

## Options

| Option | Description | Required | Default |
| ------ | ----------- | -------- | ------- |
| `<id>` |             | Yes      | -       |

> **Global options**
>
> All [global options](/docs/cli/global-options) (`--token`, `--profile`,
> `--project`, `--org`, `--json`, `--no-color`, `--no-trunc`, `--debug`) are
> also available on this command.

## Examples

```bash
# Test database connection
pgbeam db test

# Output as JSON
pgbeam db test --json
```

## Output

Renders a human-readable table or detail view by default; pass `--json` for the raw API response.