GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

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

SQL::Translator::Schema::View - SQL::Translator view object

  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
  );

"SQL::Translator::Schema::View" is the view object.

Object constructor.

  my $view = SQL::Translator::Schema::View->new;

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;

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;

Gets or appends a list of options on the view.

  $view->options('ALGORITHM=UNDEFINED');

  my @options = $view->options;

Determine whether the view is valid or not.

  my $ok = $view->is_valid;

Get or set the view's name.

  my $name = $view->name('foo');

Get or set the view's order.

  my $order = $view->order(3);

Get or set the view's SQL.

  my $sql = $view->sql('select * from foo');

Get or set the view's schema object.

  $view->schema( $schema );
  my $schema = $view->schema;

Determines if this view is the same as another

  my $isIdentical = $view1->equals( $view2 );

Ken Youens-Clark <kclark@cpan.org>.
2020-09-14 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.