The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Alzabo::Index - Index objects

SYNOPSIS

  foreach my $i ($table->indexes)
  {
     foreach my $c ($i->columns)
     {
        print $c->name;
        print '(' . $i->prefix($c) . ')' if $i->prefix($c);
    }
 }

DESCRIPTION

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.

METHODS

  • 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.

AUTHOR

Dave Rolsky, <autarch@urth.org>