Alzabo (version 0.92)

Doc index

TOC | Top

NAME

Alzabo::Create::Index - Index objects for schema creation

TOC | Top

SYNOPSIS

  use Alzabo::Create::Index;
TOC | Top

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). Some RDBMS's do not have a concept of index prefixes. Not all column types are likely to allow prefixes though this depends on the RDBMS. The order of the columns is significant.

TOC | Top

INHERITS FROM

Alzabo::Index

Note: all relevant documentation from the superclass has been merged into this document.

TOC | Top

METHODS

new

The constructor takes the following parameters:

Returns a new Alzabo::Create::Index object.

Throws: Alzabo::Exception::Params, Alzabo::Exception::RDBMSRules

TOC | Top

table

Returns the Alzabo::Create::Table object to which the index belongs.

TOC | Top

columns

Returns an ordered list of the Alzabo::Create::Column objects that are being indexed.

TOC | Top

add_column

Adds a column to the index.

This method takes the following parameters:

Throws: Alzabo::Exception::Params, Alzabo::Exception::RDBMSRules

TOC | Top

delete_column (Alzabo::Create::Column object)

Deletes the given column from the index.

Throws: Alzabo::Exception::Params, Alzabo::Exception::RDBMSRules

TOC | Top

prefix (Alzabo::Create::Column object)

A column prefix is, to the best of my knowledge, a MySQL specific concept, and as such cannot be set when using an RDBMSRules module for a different RDBMS. However, it is important enough for MySQL to have the functionality be present. It allows you to specify that the index should only look at a certain portion of a field (the first N characters). This prefix is required to index any sort of BLOB column in MySQL.

This method returns the prefix for the column in the index. If there is no prefix for this column in the index, then it returns undef.

TOC | Top

set_prefix

This method takes the following parameters:

Throws: Alzabo::Exception::Params, Alzabo::Exception::RDBMSRules

TOC | Top

unique

Returns a boolean value indicating whether the index is a unique index.

TOC | Top

set_unique ($boolean)

Sets whether or not the index is a unique index.

TOC | Top

fulltext

Returns a boolean value indicating whether the index is a fulltext index.

TOC | Top

set_fulltext ($boolean)

Set whether or not the index is a fulltext index.

Throws: Alzabo::Exception::Params, Alzabo::Exception::RDBMSRules

TOC | Top

register_column_name_change

This method takes the following parameters:

This method is called by the table object which owns the index when a column name changes. You should never need to call this yourself.

Throws: Alzabo::Exception::Params

TOC | Top

id

The id is generated from the table, column and prefix information for the index. This is useful as a canonical name for a hash key, for example.

Returns a string that is the id which uniquely identifies the index in this schema.

TOC | Top

AUTHOR

Dave Rolsky, <autarch@urth.org>


Table of Contents

- NAME
- SYNOPSIS
- DESCRIPTION
- INHERITS FROM
- METHODS
      - new
                  - table => Alzabo::Create::Table object
                  - columns => [ Alzabo::Create::Column object, .. ]
                  - columns => [ { column => Alzabo::Create::Column object, prefix => $prefix }, repeat as needed ... ]
                  - unique => $boolean
                  - fulltext => $boolean
                  - function => $string
      - table
      - columns
      - add_column
                  - column => Alzabo::Create::Column object
                  - prefix => $prefix (optional)
      - delete_column (Alzabo::Create::Column object)
      - prefix (Alzabo::Create::Column object)
      - set_prefix
                  - column => Alzabo::Create::Column object
                  - prefix => $prefix
      - unique
      - set_unique ($boolean)
      - fulltext
      - set_fulltext ($boolean)
      - register_column_name_change
                  - column => Alzabo::Create::Column object
                  - old_name => $old_name
      - id
- AUTHOR