NAME
DBIO::MySQL::Introspect - Introspect a MySQL/MariaDB database via information_schema
VERSION
version 0.900000
DESCRIPTION
DBIO::MySQL::Introspect reads the live state of a MySQL or MariaDB database via information_schema and returns a unified model hashref. It is the source side of the test-deploy-and-compare strategy used by DBIO::MySQL::Deploy.
my $intro = DBIO::MySQL::Introspect->new(dbh => $dbh);
my $model = $intro->model;
# $model->{tables}, $model->{columns}, $model->{indexes}, $model->{foreign_keys}
The model shape mirrors DBIO::PostgreSQL::Introspect and DBIO::SQLite::Introspect so the same diff/deploy patterns apply.
The introspection is scoped to the current database (the dbname component of the DSN) via DATABASE() -- to introspect a different schema, connect with that database in the DSN.
Each model section is fetched by a per-section reader under the Introspect/ subdirectory (DBIO::MySQL::Introspect::Tables, DBIO::MySQL::Introspect::Columns, DBIO::MySQL::Introspect::Indexes, DBIO::MySQL::Introspect::ForeignKeys), matching the family layout mandated by core ADR 0018. The shared $tables filter and column_type size parser live in DBIO::MySQL::Introspect::Util.
Most of the generation contract (table_keys, table_columns, table_columns_info, table_pk_info, table_uniq_info, table_fk_info, table_is_view) is provided by DBIO::Introspect::Base; this subclass only overrides the bits that are genuinely MySQL-specific -- the model assembly that delegates to the per-section readers, the view-definition source, and the result-class source_info emission.
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.