[Bast-commits] r5984 - in SQL-Abstract/1.x/trunk: lib/SQL t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Fri Apr 24 19:53:09 GMT 2009
Author: ribasushi
Date: 2009-04-24 20:53:07 +0100 (Fri, 24 Apr 2009)
New Revision: 5984
Modified:
SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm
SQL-Abstract/1.x/trunk/t/06order_by.t
Log:
Make POD more readable, add a (failing) multikey order_by test
Modified: SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm
===================================================================
--- SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm 2009-04-24 19:51:16 UTC (rev 5983)
+++ SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm 2009-04-24 19:53:07 UTC (rev 5984)
@@ -2086,21 +2086,32 @@
column name,) a hash of C<< { -desc => 'col' } >> or C<< { -asc => 'col' } >>,
or an array of either of the two previous forms. Examples:
- Given | Will Generate
- ----------------------------------------------------------
+ Given | Will Generate
+ ---------------------------------------------------------
+ |
\'colA DESC' | ORDER BY colA DESC
+ |
'colA' | ORDER BY colA
+ |
[qw/colA colB/] | ORDER BY colA, colB
+ |
{-asc => 'colA'} | ORDER BY colA ASC
+ |
{-desc => 'colB'} | ORDER BY colB DESC
- [ |
- {-asc => 'colA'}, | ORDER BY colA ASC, colB DESC
+ |
+ [ | ORDER BY colA ASC, colB DESC
+ {-asc => 'colA'}, |
{-desc => 'colB'} |
] |
- [colA => {-asc => 'colB'}] | ORDER BY colA, colB ASC
+ |
+ ['colA', {-asc => 'colB'}] | ORDER BY colA, colB ASC
+ |
{ -asc => [qw/colA colB] } | ORDER BY colA ASC, colB ASC
- { -asc => [qw/colA colB] },|
- -desc => [qw/colC colD] } | ORDER BY colA ASC, colB ASC, colC DESC, colD DESC
+ |
+ { |
+ -asc => [qw/colA colB/], | ORDER BY colA ASC, colB ASC,
+ -desc => [qw/colC colD/],| colC DESC, colD DESC
+ } |
==========================================================
Modified: SQL-Abstract/1.x/trunk/t/06order_by.t
===================================================================
--- SQL-Abstract/1.x/trunk/t/06order_by.t 2009-04-24 19:51:16 UTC (rev 5983)
+++ SQL-Abstract/1.x/trunk/t/06order_by.t 2009-04-24 19:53:07 UTC (rev 5984)
@@ -80,6 +80,11 @@
expects => ' ORDER BY colA DESC, colB DESC, colC DESC',
expects_quoted => ' ORDER BY `colA` DESC, `colB` DESC, `colC` DESC',
},
+ {
+ given => [{-desc => [ qw/colA colB/ ], -asc => [ qw/colC colD/ ] }],
+ expects => ' ORDER BY colA DESC, colB DESC, colC ASC, colD ASC',
+ expects_quoted => ' ORDER BY `colA` DESC, `colB` DESC, `colC` ASC, `colD` ASC',
+ },
);
More information about the Bast-commits
mailing list