DB::Object::Constraint::Foreign - Table Foreign Key Constraint Class
use DB::Object::Constraint::Foreign; my $foreign = DB::Object::Constraint::Foreign->new( expr => q{FOREIGN KEY (lang) REFERENCES language(lang) ON DELETE RESTRICT}, fields => [qw( lang )], match => 'simple', on_delete => 'restrict', on_update => 'nothing', name => 'fk_user_info_lang', table => 'language', ) || die( DB::Object::Constraint::Foreign->error, "\n" );
v0.1.0
This class represents a table foreign key constraint. It is instantiated by the structure method when retrieving the table structure details.
To instantiate new object, you can pass an hash or hash reference of properties matching the method names available below.
Sets or gets the foreign key constraint expression.
It returns a scalar object
Sets or gets an array reference of table field names associated with this constraint.
It returns a array object
Sets or gets the method a foreign key constraint matches.
For example: full, partial and simple
full
partial
simple
Sets or gets the foreign key constraint name.
Sets or gets the action taken by the database upon deletion of this foreign key.
For example: nothing, restrict, cascade, null or default
nothing
restrict
cascade
null
default
Sets or gets the action taken by the database upon update of this foreign key.
Sets or gets the table name for this foreign key.
Jacques Deguest <jack@deguest.jp>
https://www.postgresql.org/docs/current/tutorial-fk.html
Copyright(c) 2023 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.
To install DB::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DB::Object
CPAN shell
perl -MCPAN -e shell install DB::Object
For more information on module installation, please visit the detailed CPAN module installation guide.