NAME
DBIO::DuckDB::Diff::Index - Diff operations for DuckDB indexes
VERSION
version 0.900001
DESCRIPTION
Index-level diff operations for DuckDB. DuckDB has no ALTER INDEX, so changed definitions become a drop-then-create pair. Indexes backing PRIMARY KEY / UNIQUE constraints are filtered out upstream by the introspect layer -- they belong to the table, not to explicit CREATE INDEX.
METHODS
diff
my @ops = DBIO::DuckDB::Diff::Index->diff(
$source, $target, $source_tables, $target_tables);
Compares index sets across all tables. Index identity is by name; changed definitions become a drop-then-create pair.
The optional $source_tables / $target_tables hashrefs are the tables sections of the two models (threaded in by DBIO::DuckDB::Diff). They detect tables being dropped in this same pass: DuckDB's DROP TABLE already removes that table's own indexes, so emitting a later standalone DROP INDEX for one of them would fail once the table is gone (the diff order is tables-then-columns-then-indexes). Such drops are suppressed. When these arguments are absent (e.g. direct unit-test calls) the dropped-table set is empty and no drops are suppressed, preserving the original two-argument behaviour.
as_sql
summary
AUTHOR
DBIO Authors
COPYRIGHT AND LICENSE
Copyright (C) 2026 DBIO Authors
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.