sub _select {
my $self = shift;
+
+ # localization is neccessary as
+ # 1) there is no infrastructure to pass this around (easy to do, but will wait)
+ # 2) _select_args sets it and _prep_for_execute consumes it
my $sql_maker = $self->sql_maker;
+ local $sql_maker->{for};
+
return $self->_execute($self->_select_args(@_));
}
sub _select_args_to_query {
my $self = shift;
+ # localization is neccessary as
+ # 1) there is no infrastructure to pass this around (easy to do, but will wait)
+ # 2) _select_args sets it and _prep_for_execute consumes it
+ my $sql_maker = $self->sql_maker;
+ local $sql_maker->{for};
+
# my ($op, $bind, $ident, $bind_attrs, $select, $cond, $order, $rows, $offset)
# = $self->_select_args($ident, $select, $cond, $attrs);
my ($op, $bind, $ident, $bind_attrs, @args) =
sub _select_args {
my ($self, $ident, $select, $condition, $attrs) = @_;
- my $for = delete $attrs->{for};
my $sql_maker = $self->sql_maker;
-
- local $sql_maker->{for} = $for;
+ $sql_maker->{for} = delete $attrs->{for};
my $order = { map
{ $attrs->{$_} ? ( $_ => $attrs->{$_} ) : () }