NAME
DB::Introspector
SYNOPSIS
use DB::Introspector;
my $introspector = DB::Introspector->get_instance($dbh);
my $table = $introspector->find_table('foo');
print $table->name;
foreach my $foreign_key ($table->foreign_keys) {
print $foreign_key->foreign_table->name;
print join(",",$foreign_key->foreign_column_names);
}
my @tables = $introspector->find_tables;
DESCRIPTION
DB::Introspector looks into database metadata and derives detailed table level and foreign key information in a way that conforms to a collection common interfaces across all dbs. The DB::Introspector::Utils::* classes take advantage of these common interfaces in order to carry out relationship traversal algorithms (like finding the column level and table level mappings between two indirectly related tables).
ABSTRACT METHODS
- $introspector->find_table($table_name)
-
Params:
$table_name - the name of the table that you wish to find
Returns: DB::Introspector::Base::Table
- $introspector->find_all_tables
-
Returns: An array (@) of DB::Introspector::Base::Table instances for each table that exists in the database.
METHODS
- DB::Introspector->get_instance($dbh)
-
Params:
$dbh - An instance of a DBI database handle.
Returns: DB::Introspector instance
- $introspector->dbh
-
Returns: A DBI database handle instance (DBI::db).
SEE ALSO
DB::Introspector::Base::ForeignKey
DB::Introspector::Utils::RelInspect
DB::Introspector::Base::BooleanColumn
DB::Introspector::Base::CharColumn
DB::Introspector::Base::Column
DB::Introspector::Base::DateTimeColumn
DB::Introspector::Base::IntegerColumn
AUTHOR
Masahji C. Stewart
COPYRIGHT
The DB::Introspector module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.