Databases
TestDatabaseConnection
Test database connection
Attempts to connect to the upstream database using the stored credentials and returns the result.
Usage
result, err := client.Databases.TestDatabaseConnection(ctx)Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ctx | context.Context | Yes | Request context |
Response
(*pgbeam.TestConnectionResult, error) — connection test result.
Example
import pgbeam "github.com/pgbeam/pgbeam-go"
client := pgbeam.NewClient(&pgbeam.ClientOptions{
APIKey: "pgb_your_api_key",
})
result, err := client.Databases.TestDatabaseConnection(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)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. |