PgBeam Docs
Databases

GetSchemaCatalog

Read a database's schema catalog

Connects to the upstream database read-only and returns its user relations (tables and views) and columns. Powers table/column autocomplete and view-aware warnings in the policy editor — relation kind distinguishes a view (whose masking/row-filters apply to the view itself, not its base tables) from a base table, and a per-column is_binary flag flags columns that mask to NULL. System schemas are excluded; nothing is persisted.

Usage

result, err := client.Databases.GetSchemaCatalog(ctx, "prj_xxx", "db_xxx")

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context
projectIDstringYesUnique project identifier (prefixed, e.g. prj_xxx).
databaseIDstringYesUnique database identifier (prefixed, e.g. db_xxx).

Response

(*pgbeam.SchemaCatalog, error) — schema catalog.

Example

import pgbeam "go.pgbeam.com/sdk"

client := pgbeam.NewClient(&pgbeam.ClientOptions{
  APIKey: "pgb_your_api_key",
})

result, err := client.Databases.GetSchemaCatalog(ctx, "prj_xxx", "db_xxx")
if err != nil {
  log.Fatal(err)
}
fmt.Println(result)

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
403Operation not allowed by current plan limits.
404Resource not found.
429Rate limited. Try again later.

On this page