DBIx-Class-Events
view release on metacpan or search on metacpan
$sqlt_table->add_index(
name => 'artist_event_idx',
fields => [ "artistid", "triggered_on", "event" ],
);
}
PRECONFIGURED EVENTS
Automatically creates Events for actions that modify a row.
See the "BUGS AND LIMITATIONS" of bulk modifications on events.
insert
Logs all columns to the details column, with an insert event.
update
Logs dirty columns to the details column, with an update event.
delete
Logs all columns to the details column, with a delete event.
See the "BUGS AND LIMITATIONS" for more information about using this
method with a database enforced foreign key.
METHODS
event
Inserts a new event with "event_defaults":
my $new_event = $artist->event( $event => \%params );
= $object->result_source->new( $object->state_at($timestamp) );
See ".. format a DateTime object for searching?" under "Searching" in
DBIx::Class::Manual::FAQ for details on formatting the timestamp.
You can pass additional search conditions and attributes to this
method. This is done in context of searching the events table:
my $state = $object->state_at($timestamp, \%search_cond, \%search_attrs);
BUGS AND LIMITATIONS
There is no attempt to handle bulk updates or deletes. So, any changes
to the database made by calling "update" or "delete" will not create
events the same as single row modifications. Use the "update_all" or
"delete_all" methods of the ResultSet if you want these triggers.
If you create the belongs_to relationship described under "Tracking
Table" as a database-enforced foreign key then deleting from the
tracked table will fail due to those constraints.
lib/DBIx/Class/Events.pm view on Meta::CPAN
$sqlt_table->add_index(
name => 'artist_event_idx',
fields => [ "artistid", "triggered_on", "event" ],
);
}
=head1 PRECONFIGURED EVENTS
Automatically creates Events for actions that modify a row.
See the L</BUGS AND LIMITATIONS> of bulk modifications on events.
=over
=item insert
Logs all columns to the C<details> column, with an C<insert> event.
=item update
Logs dirty columns to the C<details> column, with an C<update> event.
=item delete
Logs all columns to the C<details> column, with a C<delete> event.
See the L</BUGS AND LIMITATIONS> for more information about
using this method with a database enforced foreign key.
=back
=head1 METHODS
=head2 event
Inserts a new event with L</event_defaults>:
lib/DBIx/Class/Events.pm view on Meta::CPAN
See ".. format a DateTime object for searching?" under L<DBIx::Class::Manual::FAQ/Searching>
for details on formatting the timestamp.
You can pass additional L<search|DBIx::Class::ResultSet/search> conditions and
attributes to this method. This is done in context of searching the events
table:
my $state = $object->state_at($timestamp, \%search_cond, \%search_attrs);
=head1 BUGS AND LIMITATIONS
There is no attempt to handle bulk updates or deletes. So, any changes to the
database made by calling
L<"update"|DBIx::Class::ResultSet/update> or L<"delete"|DBIx::Class::ResultSet/delete>
will not create events the same as L<single row|DBIx::Class::Row> modifications. Use the
L<"update_all"|DBIx::Class::ResultSet/update_all> or L<"delete_all"|DBIx::Class::ResultSet/delete_all>
methods of the C<ResultSet> if you want these triggers.
If you create the C<belongs_to> relationship
described under L</Tracking Table>
( run in 0.392 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )