---
name: "DBIx::DBSchema::Index"
section: "3pm"
platform: "linux"
package: "libdbix-dbschema-perl"
version: "0.47-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/DBIx::DBSchema::Index"
---

# DBIx::DBSchema::Index(3pm)

Index objects

## NAME

DBIx::DBSchema::Index - Index objects

## SYNOPSYS

```
  use DBIx::DBSchema::Index;
  $index = new DBIx::DBSchema::Index (
    {
    }
  );
```

## DESCRIPTION

DBIx::DBSchema::Index objects represent a unique or non-unique database index.

## METHODS

- new HASHREF \| OPTION, VALUE, ...

  Creates a new DBIx::DBschema::Index object.

  Accepts either a hashref or a list of options and values.

  Options are:

  - name - Index name

    - using - Optional index method

    - unique - Boolean indicating whether or not this is a unique index.

    - columns - List reference of column names (or expressions)

    - name \[ INDEX\_NAME \]

  Returns or sets the index name.

- using \[ INDEX\_METHOD \]

  Returns or sets the optional index method.

- unique \[ BOOL \]

  Returns or sets the unique flag.

- columns \[ LISTREF \]

  Returns or sets the indexed columns (or expressions).

- columns\_sql

  Returns a comma-joined list of columns, suitable for an SQL statement.

- sql\_create\_index TABLENAME

  Returns an SQL statment to create this index on the specified table.

- cmp OTHER\_INDEX\_OBJECT

  Compares this object to another supplied object.  Returns true if they are identical, or false otherwise.

- cmp\_noname OTHER\_INDEX\_OBJECT

  Compares this object to another supplied object.  Returns true if they are identical, disregarding index name, or false otherwise.

## AUTHOR

Ivan Kohler \<ivan-dbix-dbschema@420.am\>

Copyright (c) 2007 Ivan Kohler Copyright (c) 2007 Freeside Internet Services, Inc. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

## BUGS

Is there any situation in which sql\_create\_index needs to return a list of multiple statements?

## SEE ALSO

DBIx::DBSchema::Table, DBIx::DBSchema, DBI
