X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FQ-Branch.git;a=blobdiff_plain;f=lib%2FSQL%2FAbstract.pm;fp=lib%2FSQL%2FAbstract.pm;h=5ed6fcf415ec0f3d83967700caaa4eef2766528c;hp=1d4a14dd13cc3045753671356f8f26c8054b7045;hb=d10d5b94f1f9b2aec782007c6f528755e1b93cee;hpb=e376aa8053a377ca85e9a16205132b30436b2ce5 diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 1d4a14d..5ed6fcf 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -327,6 +327,15 @@ sub make_binop_expander { } } +sub plugin { + my ($self, $plugin, @args) = @_; + unless (ref $plugin) { + $plugin =~ s/\A\+/${\ref($self)}::Plugin::/; + require(join('/', split '::', $plugin).'.pm'); + } + $plugin->apply_to($self, @args); +} + BEGIN { foreach my $type (qw( expand op_expand render op_render clause_expand clause_render