Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sql::translator::schema::view(3pm) [debian man page]

SQL::Translator::Schema::View(3pm)			User Contributed Perl Documentation			SQL::Translator::Schema::View(3pm)

NAME
SQL::Translator::Schema::View - SQL::Translator view object SYNOPSIS
use SQL::Translator::Schema::View; my $view = SQL::Translator::Schema::View->new( name => 'foo', # name, required sql => 'select id, name from foo', # SQL for view fields => 'id, name', # field names in view ); DESCRIPTION
"SQL::Translator::Schema::View" is the view object. METHODS
new Object constructor. my $view = SQL::Translator::Schema::View->new; fields Gets and set the fields the constraint 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. $view->fields('id'); $view->fields('id', 'name'); $view->fields( 'id, name' ); $view->fields( [ 'id', 'name' ] ); $view->fields( qw[ id name ] ); my @fields = $view->fields; tables Gets and set the tables the SELECT mentions. Accepts a string, list or arrayref; returns an array or array reference. Will unique the table names and keep them in order by the first occurrence of a field name. $view->tables('foo'); $view->tables('foo', 'bar'); $view->tables( 'foo, bar' ); $view->tables( [ 'foo', 'bar' ] ); $view->tables( qw[ foo bar ] ); my @tables = $view->tables; options Gets and sets a list of options on the view. $view->options('ALGORITHM=UNDEFINED'); my @options = $view->options; is_valid Determine whether the view is valid or not. my $ok = $view->is_valid; name Get or set the view's name. my $name = $view->name('foo'); order Get or set the view's order. my $order = $view->order(3); sql Get or set the view's SQL. my $sql = $view->sql('select * from foo'); schema Get or set the view's schema object. $view->schema( $schema ); my $schema = $view->schema; equals Determines if this view is the same as another my $isIdentical = $view1->equals( $view2 ); AUTHOR
Ken Youens-Clark <kclark@cpan.org>. perl v5.14.2 2012-05-01 SQL::Translator::Schema::View(3pm)

Check Out this Related Man Page

SQL::Translator::Schema::Constraint(3pm)		User Contributed Perl Documentation		  SQL::Translator::Schema::Constraint(3pm)

NAME
SQL::Translator::Schema::Constraint - SQL::Translator constraint object SYNOPSIS
use SQL::Translator::Schema::Constraint; my $constraint = SQL::Translator::Schema::Constraint->new( name => 'foo', fields => [ id ], type => PRIMARY_KEY, ); DESCRIPTION
"SQL::Translator::Schema::Constraint" is the constraint object. METHODS
new Object constructor. my $schema = SQL::Translator::Schema::Constraint->new( table => $table, # table to which it belongs type => 'foreign_key', # type of table constraint name => 'fk_phone_id', # name of the constraint fields => 'phone_id', # field in the referring table reference_fields => 'phone_id', # referenced field reference_table => 'phone', # referenced table match_type => 'full', # how to match on_delete => 'cascade', # what to do on deletes on_update => '', # what to do on updates ); deferrable Get or set whether the constraint is deferrable. If not defined, then returns "1." The argument is evaluated by Perl for True or False, so the following are eqivalent: $deferrable = $field->deferrable(0); $deferrable = $field->deferrable(''); $deferrable = $field->deferrable('0'); expression Gets and set the expression used in a CHECK constraint. my $expression = $constraint->expression('...'); is_valid Determine whether the constraint is valid or not. my $ok = $constraint->is_valid; fields Gets and set the fields the constraint 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. The fields are returned as Field objects if they exist or as plain names if not. (If you just want the names and want to avoid the Field's overload magic use field_names). Returns undef or an empty list if the constraint has no fields set. $constraint->fields('id'); $constraint->fields('id', 'name'); $constraint->fields( 'id, name' ); $constraint->fields( [ 'id', 'name' ] ); $constraint->fields( qw[ id name ] ); my @fields = $constraint->fields; field_names Read-only method to return a list or array ref of the field names. Returns undef or an empty list if the constraint has no fields set. Useful if you want to avoid the overload magic of the Field objects returned by the fields method. my @names = $constraint->field_names; match_type Get or set the constraint's match_type. Only valid values are "full" "partial" and "simple" my $match_type = $constraint->match_type('FULL'); name Get or set the constraint's name. my $name = $constraint->name('foo'); options Gets or adds to the constraints's options (e.g., "INITIALLY IMMEDIATE"). Returns an array or array reference. $constraint->options('NORELY'); my @options = $constraint->options; on_delete Get or set the constraint's "on delete" action. my $action = $constraint->on_delete('cascade'); on_update Get or set the constraint's "on update" action. my $action = $constraint->on_update('no action'); reference_fields Gets and set the fields in the referred table. Accepts a string, list or arrayref; returns an array or array reference. $constraint->reference_fields('id'); $constraint->reference_fields('id', 'name'); $constraint->reference_fields( 'id, name' ); $constraint->reference_fields( [ 'id', 'name' ] ); $constraint->reference_fields( qw[ id name ] ); my @reference_fields = $constraint->reference_fields; reference_table Get or set the table referred to by the constraint. my $reference_table = $constraint->reference_table('foo'); table Get or set the constraint's table object. my $table = $field->table; type Get or set the constraint's type. my $type = $constraint->type( PRIMARY_KEY ); equals Determines if this constraint is the same as another my $isIdentical = $constraint1->equals( $constraint2 ); AUTHOR
Ken Youens-Clark <kclark@cpan.org>. perl v5.14.2 2012-01-18 SQL::Translator::Schema::Constraint(3pm)
Man Page