X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSet.pm;h=e1cf9c258275a4d22eef5afce4f08a2beda72c73;hb=64ea0f496829bc8be7ce43b5a3817a3da2458a81;hp=54692b0634fc6f6271c86f397f9aef848d0f2356;hpb=0ab4d12d64c3711ad2f428bff1b7a363f03f1b83;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 54692b0..e1cf9c2 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -2555,22 +2555,26 @@ These are in no particular order: =over 4 -=item Value: ($order_by | \@order_by) +=item Value: ( $order_by | \@order_by | \%order_by ) =back -Which column(s) to order the results by. This is currently passed -through directly to SQL, so you can give e.g. C for a -descending order on the column `year'. +Which column(s) to order the results by. If a single column name, or +an arrayref of names is supplied, the argument is passed through +directly to SQL. The hashref syntax allows for connection-agnostic +specification of ordering direction: -Please note that if you have C enabled (see -L) you will need to do C<\'year DESC' > to -specify an order. (The scalar ref causes it to be passed as raw sql to the DB, -so you will need to manually quote things as appropriate.) + For descending order: -If your L version supports it (>=1.50), you can also use -C<{-desc => 'year'}>, which takes care of the quoting for you. This is the -recommended syntax. + order_by => { -desc => [qw/col1 col2 col3/] } + + For explicit ascending order: + + order_by => { -asc => 'col' } + +The old scalarref syntax (i.e. order_by => \'year DESC') is still +supported, although you are strongly encouraged to use the hashref +syntax as outlined above. =head2 columns @@ -2611,6 +2615,16 @@ passed to object inflation. Note that the 'artist' is the name of the column (or relationship) accessor, and 'name' is the name of the column accessor in the related table. +=head2 include_columns + +=over 4 + +=item Value: \@columns + +=back + +Deprecated. Acts as a synonym for L for backward compatibility. + =head2 select =over 4