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::Trigger(3) User Contributed Perl Documentation SQL::Translator::Schema::Trigger(3)

SQL::Translator::Schema::Trigger - SQL::Translator trigger object

  use SQL::Translator::Schema::Trigger;
  my $trigger = SQL::Translator::Schema::Trigger->new(
    name                => 'foo',
    perform_action_when => 'before', # or after
    database_events     => [qw/update insert/], # also update, update_on, delete
    fields              => [],       # if event is "update"
    on_table            => 'foo',    # table name
    action              => '...',    # text of trigger
    schema              => $schema,  # Schema object
    scope               => 'row',    # or statement
  );

"SQL::Translator::Schema::Trigger" is the trigger object.

Object constructor.

  my $schema = SQL::Translator::Schema::Trigger->new;

Gets or sets whether the event happens "before" or "after" the "database_event".

  $trigger->perform_action_when('after');

Obsolete please use database_events!

Gets or sets the events that triggers the trigger.

  my $ok = $trigger->database_events('insert');

Gets and set which fields to monitor for "database_event".

  $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 or set the table on which the trigger works, as a SQL::Translator::Schema::Table object. $trigger->table($triggered_table);

Gets or set the table name on which the trigger works, as a string. $trigger->on_table('foo');

Gets or set the action of the trigger.

  $trigger->action(
      q[
        BEGIN
          select ...;
          update ...;
        END
      ]
  );

Determine whether the trigger is valid or not.

  my $ok = $trigger->is_valid;

Get or set the trigger's name.

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

Get or set the trigger's order.

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

Get or set the trigger's scope (row or statement).

    my $scope = $trigger->scope('statement');

Get or set the trigger's schema object.

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

Compare two arrays.

Determines if this trigger is the same as another

  my $is_identical = $trigger1->equals( $trigger2 );

Anonymous, 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.