DBIx::SystemCatalog is a Perl module for accessing system catalog in common databases (access through DBI(3)).
SYNOPSIS
use DBI;
use DBIx::SystemCatalog;
# create DBIx::SystemCatalog object and bind DBI
my $dbh = DBI->connect('dbi:Oracle:','login','password');
my $catalog = new DBIx::SystemCatalog $dbh;
# fetch all database schemas
my @schemas = $catalog->schemas;
# select one schema (e.g. first schema)
$catalog->schema($schemas[0]);
# fetch all tables and views with types of objects
my @tables = $catalog->tables_with_types;
# fetch columns of first fetched table
my @columns = $catalog->table_columns($tables[0]->{name});
# fetch all relationships between tables and views
my @relationships = $catalog->relationships;
# fetch all primary keys for table
my @primary_keys = $catalog->primary_keys($tables[0]->{name});
# fetch all unique indexes for table
my @unique_indexes = $catalog->unique_indexes($tables[0]->{name});
# fetch all indexes for table
my @indexes = $catalog->indexes($table[0]->{name});
# disconnect database
$dbh->disconnect;
This module can access to system catalog of database through DBI(3) interface. Basic methods access to objects through standard DBI(3) interface (call tables() for list of objects and selectall_arrayref() with basic SQL to get structure of objects).
Constructor looks for specific module implemented database interface for used DBD driver (obtained from DBI(3)). These module can add faster and better functions such as relationships or types of objects.
Product's homepage
Requirements:
· Perl