GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Alzabo::Create::Index(3) User Contributed Perl Documentation Alzabo::Create::Index(3)

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

  use Alzabo::Create::Index;

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.

"Alzabo::Index"

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

The constructor takes the following parameters:
  • table => "Alzabo::Create::Table" object

    The table that this index is indexing.

  • columns => [ "Alzabo::Create::Column" object, .. ]
  • columns => [ { column => "Alzabo::Create::Column" object, prefix => $prefix }, repeat as needed ... ]

    This parameter indicates which columns that are being indexed. It can either be an array reference of column objects, or an array reference of hash references, each with a key called column and one called prefix.

    The prefix key is optional.

  • unique => $boolean

    Indicates whether or not this is a unique index.

  • fulltext => $boolean

    Indicates whether or not this is a fulltext index.

  • function => $string

    This can be used to create a function index where supported. The value of this parameter should be the full function, with column names, such as "LCASE( username )".

    The "columns" parameter should include all the columns used in the function.

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

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

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

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

Adds a column to the index.

This method takes the following parameters:

  • column => "Alzabo::Create::Column" object
  • prefix => $prefix (optional)

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

Deletes the given column from the index.

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

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.

This method takes the following parameters:
  • column => "Alzabo::Create::Column" object
  • prefix => $prefix

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

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

Sets whether or not the index is a unique index.

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

Set whether or not the index is a fulltext index.

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

This method takes the following parameters:
  • column => "Alzabo::Create::Column" object

    The column (with the new name already set).

  • old_name => $old_name

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"

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.

Dave Rolsky, <autarch@urth.org>
2022-04-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.