- Remove obsolete documentation about arrayrefref as the $source
argument for ->select (removed in version 1.74)
+ - Factor out the field list part of SELECT for subclassability (GH#13)
1.85 - 2018-01-27
- Restore perl version requirement missed in the Distar port
my $where = shift;
my $order = shift;
- my($where_sql, @bind) = $self->where($where, $order);
+ my ($fields_sql, @bind) = $self->_select_fields($fields);
- my $f = (ref $fields eq 'ARRAY') ? join ', ', map { $self->_quote($_) } @$fields
- : $fields;
- my $sql = join(' ', $self->_sqlcase('select'), $f,
+ my ($where_sql, @where_bind) = $self->where($where, $order);
+ push @bind, @where_bind;
+
+ my $sql = join(' ', $self->_sqlcase('select'), $fields_sql,
$self->_sqlcase('from'), $table)
. $where_sql;
return wantarray ? ($sql, @bind) : $sql;
}
+sub _select_fields {
+ my ($self, $fields) = @_;
+ return ref $fields eq 'ARRAY' ? join ', ', map { $self->_quote($_) } @$fields
+ : $fields;
+}
+
#======================================================================
# DELETE
#======================================================================