PgBeam Docs
Migrations

lintMigration

Lint a migration

Analyzes a migration script for unsafe schema changes and returns findings.

Usage

const result = await api.migrations.lintMigration({
  pathParams: { project_id: "prj_xxx" },
  body: {
    sql: "...",
  },
});

Parameters

ParameterTypeRequiredDescription
pathParams.project_idstringYesUnique project identifier (prefixed, e.g. prj_xxx).
body.sqlstringYesThe migration SQL to analyze. May contain multiple statements.
body.database_idstringNoOptional database to scope the lint to.

Response

Promise<MigrationLintResponse> — lint results.

Example

import { PgBeamClient } from "pgbeam";

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

const result = await client.api.migrations.lintMigration({
  pathParams: { project_id: "prj_xxx" },
  body: {
    sql: "...",
  },
});

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
403Operation not allowed by current plan limits.
404Resource not found.

On this page