NAME

DBIO::Diff::Base - Base class for DBIO driver diff orchestrators

VERSION

version 0.900001

DESCRIPTION

Base class for driver-specific diff orchestrators (DBIO::PostgreSQL::Diff, DBIO::SQLite::Diff, DBIO::MySQL::Diff). Provides the full public interface; subclasses implement only _build_operations.

ATTRIBUTES

source

The current (live) database model hashref. Required.

target

The desired (deployed from DBIO classes) database model hashref. Required.

operations

ArrayRef of diff operation objects. Built lazily. Each object must respond to as_sql and summary.

METHODS

has_changes

if ($diff->has_changes) { ... }

Returns true if there is at least one diff operation.

as_sql

my $sql = $diff->as_sql;

Returns all diff operations concatenated as a SQL migration script.

summary

my $text = $diff->summary;

Returns a human-readable summary of all diff operations.

CONTRACT VERSION

This class exposes an independent compatibility version, distinct from $VERSION (the dist version injected by Dist::Zilla's VersionFromMainModule):

my $v = $class->contract_version;

$CONTRACT_VERSION bumps when the diff orchestrator's public interface (source, target, operations, has_changes, as_sql, summary) or the operation-object contract (DBIO::Diff::Op) changes. The dist $VERSION bumps on every release, but two core releases at the same contract version remain wire-compatible. Out-of-tree drivers should record the contract version they were last tested against and compare it against core's at load time, warning (or strict-failing under DBIO_STRICT_CONTRACT) when the shapes have drifted. See docs/adr/ for the contract-version policy.

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.