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

NAME

Alzabo::Table - Table objects

SYNOPSIS

  use Alzabo::Table;

  my $t = $schema->table('foo');

  foreach $pk ($t->primary_keys)
  {
     print $pk->name;
  }

DESCRIPTION

Objects in this class represent tables. They contain foreign key, index, and column objects.

METHODS

  • schema

    Returns the schema object that this table belong to.

  • name

    Returns the name of the table.

  • column ($name)

    Returns an Alzabo::Column object that matches the name given.

  • columns

    Returns all column objects for the table.

  • primary_key

    Returns a list of column objects that make up the primary key for the table.

  • column_is_primary_key (Alzabo::Column object)

    Returns a boolean value indicating whether or not the column given is part of the table's primary key.

  • foreign_keys

    Takes the following parameters:

  • -- column => Alzabo::Column object

  • -- table => Alzabo::Table object

    Returns a list of foreign key objects from the given column to the given table, if they exist. In scalar context, returns the first item in the list. There is no guarantee as to what the first item will be.

    Exceptions:

     AlzaboException - Column doesn't exist in table
     AlzaboException - No foreign keys to the given table exist.
     AlzaboException - The given column is not a foreign key to the given table.
  • foreign_keys_by_table (Alzabo::Table object)

    Returns a list of all the foreign key objects to the given table. In scalar context, returns the first item in the list. There is no guarantee as to what the first item will be.

  • foreign_keys_by_column (Alzabo::Column object)

    Returns a list of all the foreign key objects that the given column is a part of, if there are any. In scalar context, returns the first item in the list. There is no guarantee as to what the first item will be.

    Exceptions:

     AlzaboException - Column doesn't exist in table
  • all_foreign_keys

    Returns a list of all the foreign key objects for this table. In scalar context, returns the first item in the list. There is no guarantee as to what the first item will be.

  • index ($index_id)

    Given an index id (as returned from the Alzabo::Index id method), returns the index matching this id, if it exists in the table.

    Exceptions:

     AlzaboException - Index doesn't exist in table
  • indexes

    Returns all index objects for the table.

AUTHOR

Dave Rolsky, <autarch@urth.org>

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 217:

Expected '=item *'

Around line 219:

Expected '=item *'