.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 2024-01-20 "perl v5.38.2" "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 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. .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 SQL. .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 .