[DBIx-Class-Devel] [dbsrgits/sql-abstract] Add overloadable _select_field_values method (#13)

Dagfinn Ilmari Mannsåker notifications at github.com
Sun Jan 28 14:10:02 GMT 2018


ilmari requested changes on this pull request.



> @@ -466,15 +466,21 @@ sub select {
 
   my($where_sql, @bind) = $self->where($where, $order);
 
-  my $f = (ref $fields eq 'ARRAY') ? join ', ', map { $self->_quote($_) } @$fields
-                                   : $fields;
-  my $sql = join(' ', $self->_sqlcase('select'), $f,
+  my ($fields_sql, @fields_bind) = $self->_select_field_values($fields);
+  push @bind, @fields_bind;

Because `$fields_sql` comes before `$where_sql`, `@fields_bind` need to come before the bind values returned by `->where()`. I'd suggest moving the whole fields part before the where part, to make this clearer.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/sql-abstract/pull/13#pullrequestreview-92054127
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20180128/04fe1f16/attachment-0001.htm>


More information about the DBIx-Class-Devel mailing list