PgBeam
PgBeam Docs
SchemaAnnotations

putSchemaAnnotation

Create or replace a schema annotation

Attaches an operator-written description to a table (omit column_name) or a column. Keyed by (schema_name, table_name, column_name); an existing annotation with the same key is replaced.

Usage

const result = await api.schemaannotations.putSchemaAnnotation({
  pathParams: { project_id: "prj_xxx" },
  body: {
    table_name: "users",
    description: "Primary customer account. One row per signed-up user.",
  },
});

Parameters

ParameterTypeRequiredDescription
pathParams.project_idstringYesUnique project identifier (prefixed, e.g. prj_xxx).
body.schema_namestringNoOptional schema. Null or empty matches the unqualified form.
body.table_namestringYesRelation (table or view) the annotation describes.
body.column_namestringNoOptional column. Null describes the table itself.
body.descriptionstringYesThe operator-written description text.

Response

Promise<SchemaAnnotation>: the created or updated annotation.

Example

import { PgBeamClient } from "pgbeam";

const client = new PgBeamClient({
  token: "pbk_...",
  baseUrl: "https://api.pgbeam.com",
});

const result = await client.api.schemaannotations.putSchemaAnnotation({
  pathParams: { project_id: "prj_xxx" },
  body: {
    table_name: "users",
    description: "Primary customer account. One row per signed-up user.",
  },
});

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