my $self = shift;
# localization is neccessary as
- # 1) there is no infrastructure to pass this around (easy to do, but will wait)
+ # 1) there is no infrastructure to pass this around before SQLA2
# 2) _select_args sets it and _prep_for_execute consumes it
my $sql_maker = $self->sql_maker;
- local $sql_maker->{for};
+ local $sql_maker->{_dbic_rs_attrs};
return $self->_execute($self->_select_args(@_));
}
my $self = shift;
# localization is neccessary as
- # 1) there is no infrastructure to pass this around (easy to do, but will wait)
+ # 1) there is no infrastructure to pass this around before SQLA2
# 2) _select_args sets it and _prep_for_execute consumes it
my $sql_maker = $self->sql_maker;
- local $sql_maker->{for};
+ local $sql_maker->{_dbic_rs_attrs};
# my ($op, $bind, $ident, $bind_attrs, $select, $cond, $order, $rows, $offset)
# = $self->_select_args($ident, $select, $cond, $attrs);
my ($self, $ident, $select, $condition, $attrs) = @_;
my $sql_maker = $self->sql_maker;
- $sql_maker->{for} = delete $attrs->{for};
+ $sql_maker->{_dbic_rs_attrs} = $attrs;
my $order = { map
{ $attrs->{$_} ? ( $_ => $attrs->{$_} ) : () }
sub _resolve_column_info {
my ($self, $ident, $colnames) = @_;
my $alias2src = $self->_resolve_ident_sources($ident);
- my $name_sep = $self->_sql_maker_opts->{name_sep} || '.';
+
+ my $sep = $self->_sql_maker_opts->{name_sep} || '.';
+ $sep = "\Q$sep\E";
+
my %return;
foreach my $col (@{$colnames}) {
- $col =~ m/^([^\Q${name_sep}\E]*)\Q${name_sep}\E/;
+ $col =~ m/^ (?: ([^$sep]+) $sep)? (.+) $/x;
+
my $alias = $1 || 'me';
+ my $colname = $2;
+
my $rsrc = $alias2src->{$alias};
- $return{$col} = $rsrc && { %{$rsrc->column_info($col)}, -result_source => $rsrc };
+ $return{$col} = $rsrc && { %{$rsrc->column_info($colname)}, -result_source => $rsrc };
}
return \%return;
}