NAME

DBIO::SQLite::Diff::Table - Diff operations for SQLite tables

VERSION

version 0.900000

DESCRIPTION

Represents a table-level diff operation in SQLite: CREATE TABLE or DROP TABLE. Unlike PostgreSQL, where the table shell can be created empty and columns added one at a time, SQLite is much friendlier when the full table definition is emitted at once -- so for create operations the SQL is generated directly from the introspected target columns (and any FKs / PK constraints) inline.

METHODS

diff

my @ops = DBIO::SQLite::Diff::Table->diff(
    $source_tables, $target_tables,
    $target_columns, $target_fks,
);

Compares two table hashrefs (keyed by table name) and returns create ops for tables present only in target and drop ops for tables only in source. create ops capture the target columns and FKs so as_sql can render the full inline definition.

as_sql

Returns the SQL for this operation. For create, emits a full CREATE TABLE with columns, primary key, and foreign keys inline. For drop, emits DROP TABLE.

summary

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.