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
+ } |
==========================================================
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',
+ },
);