Skip to main content

detect_fill_required

Function detect_fill_required 

Source
pub fn detect_fill_required(
    target: &SchemaDescriptor,
    current: &DbState,
) -> Vec<FillRequired>
Expand description

Detect all properties that are being made NOT NULL but whose existing rows may contain NULL values and therefore require a fill expression.

Returns a FillRequired for:

  • New NOT NULL columns without a schema-level default= on existing tables.
  • Existing nullable columns that the target marks as NOT NULL (with or without a default — the default is surfaced as default_sql for auto-fill).

New tables are excluded (no rows yet). PK columns are excluded (always NOT NULL by definition).