Quick Navigator

Search Site

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

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages
SQL::Translator::Schema::Index(3) User Contributed Perl Documentation SQL::Translator::Schema::Index(3)

SQL::Translator::Schema::Index - SQL::Translator index object

  use SQL::Translator::Schema::Index;
  my $index = SQL::Translator::Schema::Index->new(
      name   => 'foo',
      fields => [ id ],
      type   => 'unique',

"SQL::Translator::Schema::Index" is the index object.
Primary and unique keys are table constraints, not indices.

Object constructor.
  my $schema = SQL::Translator::Schema::Index->new;

Gets and set the fields the index is on. Accepts a string, list or arrayref; returns an array or array reference. Will unique the field names and keep them in order by the first occurrence of a field name.
  $index->fields('id', 'name');
  $index->fields( 'id, name' );
  $index->fields( [ 'id', 'name' ] );
  $index->fields( qw[ id name ] );
  my @fields = $index->fields;

Determine whether the index is valid or not.
  my $ok = $index->is_valid;

Get or set the index's name.
  my $name = $index->name('foo');

Get or set the index's options (e.g., "using" or "where" for PG). Returns an array or array reference.
  my @options = $index->options;

Get or set the index's table object.
  my $table = $index->table;

Get or set the index's type.
  my $type = $index->type('unique');
Get or set the index's type.
Currently there are only four acceptable types: UNIQUE, NORMAL, FULL_TEXT, and SPATIAL. The latter two might be MySQL-specific. While both lowercase and uppercase types are acceptable input, this method returns the type in uppercase.

Determines if this index is the same as another
  my $isIdentical = $index1->equals( $index2 );

Ken Youens-Clark <>.
2013-06-28 perl v5.28.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.