DBIx::Inspector - Get information from $dbh
use DBIx::Inspector; my $dbh = DBI->connect(...) or die; my $inspector = DBIx::Inspector->new(dbh => $dbh); my @tables = $inspector->tables; for my $table (@tables) { print " pk:\n"; for my $pk ($table->primary_key) { print " ", $pk->name, "\n"; } print " columns:\n"; for my $column ($table->columns) { print " ", $column->name, "\n"; } }
DBIx::Inspector is a inspector for $dbh.
This is under development. Any API will change without notice.
Create new instance of DBIx::Inspector.
Retrieve table objects from $dbh. Every elements in @tables is instance of DBIx::Inspector::Table.
Retrieve table object from $dbh. Return value is instance of DBIx::Inspector::Table.
Retrieve view objects from $dbh. Every elements in @views is instance of DBIx::Inspector::Table.
Retrieve view object from $dbh. Return value is instance of DBIx::Inspector::Table.
Tokuhiro Matsuno <tokuhirom AAJKLFJEF@ GMAIL COM>
DBI
Copyright (C) Tokuhiro Matsuno
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install DBIx::Inspector, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Inspector
CPAN shell
perl -MCPAN -e shell install DBIx::Inspector
For more information on module installation, please visit the detailed CPAN module installation guide.