PgBeam Docs
Databases

ScanDatabaseForPii

Scan a database for likely-PII columns

Connects to the upstream database read-only, inspects information_schema and samples column values against PII heuristics, and returns ranked masking suggestions. Suggestions are advisory — the operator reviews them and applies the ones they want into a policy profile's masking rules. Nothing is auto-applied.

Usage

result, err := client.Databases.ScanDatabaseForPii(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.ScanPiiResult, error) — pii scan result.

Example

import pgbeam "go.pgbeam.com/sdk"

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

result, err := client.Databases.ScanDatabaseForPii(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