s/\A\s+//, s/\s+\Z// for $sql;
return [ $sql, @bind ];
};
+ $opt{expand_op}{ident} = sub {
+ my ($self, undef, $body) = @_;
+ $body = $body->from if Scalar::Util::blessed($body);
+ $self->_expand_ident(ident => $body);
+ };
}
}
sub plugin {
my ($self, $plugin, @args) = @_;
unless (ref $plugin) {
- $plugin =~ s/\A\+/${\ref($self)}::Plugin::/;
+ $plugin =~ s/\A\+/${\__PACKAGE__}::Plugin::/;
require(join('/', split '::', $plugin).'.pm');
}
$plugin->apply_to($self, @args);