Alzabo::Index - Index objects
foreach my $i ($table->indexes) { foreach my $c ($i->columns) { print $c->name; print '(' . $i->prefix($c) . ')' if $i->prefix($c); } }
This object represents an index on a table. Indexes consist of columns and optional prefixes for each column. The prefix specifies how many characters of the columns should be indexes (the first X chars). Not all column types are likely to allow prefixes though this depends on the RDBMS. The order of the columns is significant.
columns
Returns an ordered list of columns that are part of the index.
prefix ($column)
Given a column object that is part of the index, this method returns the prefix of the index. If there is no prefix for this column in the index, then it returns undef.
Exceptions:
AlzaboException - The given column is not part of the index.
unique
Returns a boolean value indicating whether or not the index is a unique index.
id
Returns an id for the index, which is generated from the tasble, column and prefix information for the index. This is useful as a cardinal name for hashing.
table
Returns the table object that the index belongs to.
Dave Rolsky, <autarch@urth.org>
To install Alzabo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Alzabo
CPAN shell
perl -MCPAN -e shell install Alzabo
For more information on module installation, please visit the detailed CPAN module installation guide.