PgFlow.SchemaCheck (PgFlow v0.4.0)

Copy Markdown View Source

Verifies that a database matches the pgflow schema contract expected by this library release.

mix pgflow.check_schema checks installed core/helpers versions, function signatures, queue constraints, and the eight-field step_task_record layout. Worker startup uses runtime_checks/1 for signatures, legacy claim absence, field names and types, and the helpers version floor before reserving messages.

Summary

Functions

Runs all schema compatibility checks against repo.

Checks the claim and startup protocol before any worker reserves messages. Connectivity failures retain their original error; incompatible schemas return {:error, {:schema_incompatible, object}}.

Functions

run(repo)

@spec run(module()) :: :ok | {:error, [String.t()]}

Runs all schema compatibility checks against repo.

Returns :ok when every check passes, or {:error, messages} with one human-readable message per failed check.

runtime_checks(repo)

@spec runtime_checks(module()) :: :ok | {:error, term()}

Checks the claim and startup protocol before any worker reserves messages. Connectivity failures retain their original error; incompatible schemas return {:error, {:schema_incompatible, object}}.