/usr/local/perl/lib/site_perl/5.8.5/DB/Introspector/Base/ForeignKey.pm |
DB::Introspector::Base::ForeignKey
use DB::Introspector;
my $introspector = DB::Introspector->get_instance($dbh);
my $table = $introspector->find_table('users');
foreach my $foreign_key ($table->foreign_keys) {
print "Foreign Key name:\t".$foreign_key->name."\n";
print "Foreign Key local table:\t".$foreign_key->local_table->name."\n";
print "Foreign Key foreign table:\t".$foreign_key->foreign_table->name."\n";
}
=head1 DESCRIPTION
DB::Introspector::Base::ForeignKey is a class that represents a table's foreign key. The 'local_table' is the table that depends on the foreign table. This (local_table) can be considered the child table because data in the local table depends on the existence of data in the foreign table.
Returns: The table that the 'local_table' depends on.
Returns: an array (@) of foreign column names in order such that they can be mapped to the local column names.
Returns: an array (@) of local column names in order such that they can be mapped to the foreign column names.
Params:
$local_table - a DB::Introspector::Base::Table instance
Returns: an instance of a DB::Introspector::Base::ForeignKey
Returns: The child table in this foreign key relationship
the DB::Introspector::Base::Table manpage
Masahji C. Stewart
The DB::Introspector::Base::ForeignKey module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
/usr/local/perl/lib/site_perl/5.8.5/DB/Introspector/Base/ForeignKey.pm |