1 package SQL::Abstract::Role::Plugin;
6 is => 'ro', init_arg => undef,
8 expand_expr render_aqt join_query_parts
13 my ($self, $method, @args) = @_;
15 local $self->{sqla} = shift;
16 $self->$method(@args, @_)
21 my ($self, @pairs) = @_;
22 my $sqla = $self->sqla;
23 while (my ($method, $cases) = splice(@pairs, 0, 2)) {
25 while (my ($name, $case) = splice(@cases, 0, 2)) {
26 $sqla->$method($name, $self->cb($case));
33 my ($self, $sqla) = @_;
34 $self = $self->new unless ref($self);
35 local $self->{sqla} = $sqla;
36 $self->register_extensions($sqla);
39 requires 'register_extensions';
47 SQL::Abstract::Role::Plugin - helpful methods for plugin authors
53 Applies the plugin to an L<SQL::Abstract> object.
55 =head2 register_extensions
57 Provided by the plugin, registers its extensions to the sqla object.
61 Creates a callback to call a method on the plugin.
65 Calls methods on the sqla object with arguments wrapped as callbacks.
69 Available only during plugin callback executions, contains the currently
70 active L<SQL::Abstract> object.