JezK
Edit File: SQL::Translator::Schema::View.3pm
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "SQL::Translator::Schema::View 3pm" .TH SQL::Translator::Schema::View 3pm "2019-05-29" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" SQL::Translator::Schema::View \- SQL::Translator view object .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 6 \& use SQL::Translator::Schema::View; \& my $view = SQL::Translator::Schema::View\->new( \& name => \*(Aqfoo\*(Aq, # name, required \& sql => \*(Aqselect id, name from foo\*(Aq, # SQL for view \& fields => \*(Aqid, name\*(Aq, # field names in view \& ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`SQL::Translator::Schema::View\*(C'\fR is the view object. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" Object constructor. .PP .Vb 1 \& my $view = SQL::Translator::Schema::View\->new; .Ve .SS "fields" .IX Subsection "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. .PP .Vb 5 \& $view\->fields(\*(Aqid\*(Aq); \& $view\->fields(\*(Aqid\*(Aq, \*(Aqname\*(Aq); \& $view\->fields( \*(Aqid, name\*(Aq ); \& $view\->fields( [ \*(Aqid\*(Aq, \*(Aqname\*(Aq ] ); \& $view\->fields( qw[ id name ] ); \& \& my @fields = $view\->fields; .Ve .SS "tables" .IX Subsection "tables" Gets and set the tables the \s-1SELECT\s0 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. .PP .Vb 5 \& $view\->tables(\*(Aqfoo\*(Aq); \& $view\->tables(\*(Aqfoo\*(Aq, \*(Aqbar\*(Aq); \& $view\->tables( \*(Aqfoo, bar\*(Aq ); \& $view\->tables( [ \*(Aqfoo\*(Aq, \*(Aqbar\*(Aq ] ); \& $view\->tables( qw[ foo bar ] ); \& \& my @tables = $view\->tables; .Ve .SS "options" .IX Subsection "options" Gets or appends a list of options on the view. .PP .Vb 1 \& $view\->options(\*(AqALGORITHM=UNDEFINED\*(Aq); \& \& my @options = $view\->options; .Ve .SS "is_valid" .IX Subsection "is_valid" Determine whether the view is valid or not. .PP .Vb 1 \& my $ok = $view\->is_valid; .Ve .SS "name" .IX Subsection "name" Get or set the view's name. .PP .Vb 1 \& my $name = $view\->name(\*(Aqfoo\*(Aq); .Ve .SS "order" .IX Subsection "order" Get or set the view's order. .PP .Vb 1 \& my $order = $view\->order(3); .Ve .SS "sql" .IX Subsection "sql" Get or set the view's \s-1SQL.\s0 .PP .Vb 1 \& my $sql = $view\->sql(\*(Aqselect * from foo\*(Aq); .Ve .SS "schema" .IX Subsection "schema" Get or set the view's schema object. .PP .Vb 2 \& $view\->schema( $schema ); \& my $schema = $view\->schema; .Ve .SS "equals" .IX Subsection "equals" Determines if this view is the same as another .PP .Vb 1 \& my $isIdentical = $view1\->equals( $view2 ); .Ve .SH "AUTHOR" .IX Header "AUTHOR" Ken Youens-Clark <kclark@cpan.org>.