NAME
DB::Object::Constraint::Index - Table Index Constraint Class
SYNOPSIS
use DB::Object::Constraint::Index;
my $idx = DB::Object::Constraint::Index->new(
fields => [qw( id )],
is_primary => 1,
is_unique => 1,
name => 'pk_some_table',
) || die( DB::Object::Constraint::Index->error, "\n" );
VERSION
v0.2.0
DESCRIPTION
This class represents a table index constraint. It is instantiated by the structure method when retrieving the table structure details.
CONSTRUCTOR
new
To instantiate new object, you can pass an hash or hash reference of properties matching the method names available below.
METHODS
fields
my $value = $constraint->fields;
$constraint->fields( $value );
Sets or gets an array reference of table field names associated with this constraint.
It returns a array object
is_primary
my $value = $constraint->is_primary;
$constraint->is_primary( $value );
Sets or gets a boolean value whether this constraint is a primary index, or not.
Returns a boolean object
is_unique
my $value = $constraint->is_unique;
$constraint->is_unique( $value );
Sets or gets a boolean value whether this constraint is a unique constraint, or not.
Returns a boolean object
name
my $value = $constraint->name;
$constraint->name( $value );
Sets or gets the index constraint name.
It returns a scalar object
AUTHOR
Jacques Deguest <jack@deguest.jp>
SEE ALSO
COPYRIGHT & LICENSE
Copyright(c) 2023-2026 DEGUEST Pte. Ltd.
All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.