module Prostore::Diff::Validator

Overview

Validates the desired model state against the existing prostore_schema state, enforcing the constraints from ADR-0003 (no in-place type changes), ADR-0008 (reservation interlocks), and ADR-0011 (non-nullable adds against non-empty tables require backfill:).

The validator runs before the planner. If validation fails, no DDL is planned or executed. The errors raised here are the user-facing failures of "your model is incompatible with the existing database state." All cross-checks here are static — they don't query the live DB.

Extended Modules

Defined in:

prostore/diff/validator.cr

Instance Method Summary

Instance Method Detail

def validate(models : Array(Prostore::Model.class), schema_rows : Array(Drift::SchemaTable::Row)) : Nil #

[View source]
def validate_table(definition : Schema::Definition, rows : Array(Drift::SchemaTable::Row)) : Nil #

[View source]