NAME

DBIO::DB2::Introspect - Introspect a DB2 database via SYSCAT + information_schema

VERSION

version 0.900000

DESCRIPTION

DBIO::DB2::Introspect reads the live state of a DB2 database via SYSCAT and information_schema, returning a unified model hashref. It is the source side of the test-deploy-and-compare strategy used by DBIO::DB2::Deploy.

my $intro = DBIO::DB2::Introspect->new(dbh => $dbh);
my $model = $intro->model;

Model shape mirrors DBIO::DuckDB::Introspect:

{
    tables       => { $name => { ... } },
    columns      => { $table => [ { ... }, ... ] },
    indexes      => { $table => { $name => { ... } } },
    foreign_keys => { $table => [ { ... }, ... ] },
}

ATTRIBUTES

schema

DB2 schema to introspect. Defaults to USER (current user's schema).

METHODS

table_fk_info

table_is_view

NORMALIZED CONTRACT

The DBIO::Introspect::Base contract used by DBIO::Generate is satisfied by the base-class defaults: the native model built by _build_model already uses the canonical shape (bare table-name keys; columns with column_name/data_type/size/not_null/default_value/is_pk/ pk_position/is_auto_increment; indexes with origin marking the PK index; tables with kind). So table_keys, table_columns, table_columns_info, table_pk_info, table_uniq_info and table_is_view are inherited unchanged.

Only table_fk_info is overridden: DB2 carries the constraint name and the referenced schema, which the generic default drops.

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.