Databases
testDatabaseConnection
Test database connection
Attempts to connect to the upstream database using the stored credentials and returns the result.
Usage
const result = await api.databases.testDatabaseConnection({
pathParams: { project_id: "prj_xxx", database_id: "db_xxx" },
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| pathParams.project_id | string | Yes | Unique project identifier (prefixed, e.g. prj_xxx). |
| pathParams.database_id | string | Yes | Unique database identifier (prefixed, e.g. db_xxx). |
Response
Promise<TestConnectionResult> — connection test result.
Example
import { PgBeamClient } from "pgbeam";
const client = new PgBeamClient({
token: "pbk_...",
baseUrl: "https://api.pgbeam.com",
});
const result = await client.api.databases.testDatabaseConnection({
pathParams: { project_id: "prj_xxx", database_id: "db_xxx" },
});Errors
| Status | Description |
|---|---|
| 400 | Invalid request parameters. |
| 401 | Missing or invalid authentication. |
| 403 | Operation not allowed by current plan limits. |
| 404 | Resource not found. |
| 429 | Rate limited. Try again later. |