6 use Data::Dumper::Concise;
9 use DBIC::SqlMakerTest;
11 my $schema = DBICTest->init_schema;
13 my $rs = $schema->resultset('FourKeys');
20 local $TODO = "Not implemented" if $args->{todo};
27 order_by => $args->{order_by},
29 [ { read_count => { '>' => 5 } }, \[ 'read_count < ?', [ read_count => 8 ] ] ]
33 SELECT me.foo, me.bar, me.hello, me.goodbye, me.sensors, me.read_count
36 HAVING read_count > ? OR read_count < ?
37 ORDER BY $args->{order_req}
47 ) || diag Dumper $args->{order_by};
54 order_by => \'foo DESC',
55 order_req => 'foo DESC',
59 order_by => { -asc => 'foo' },
60 order_req => 'foo ASC',
64 order_by => { -desc => \[ 'colA LIKE ?', [ colA => 'test' ] ] },
65 order_req => 'colA LIKE ? DESC',
66 bind => [ [ colA => 'test' ] ],
69 order_by => \[ 'colA LIKE ? DESC', [ colA => 'test' ] ],
70 order_req => 'colA LIKE ? DESC',
71 bind => [ [ colA => 'test' ] ],
75 { -asc => \['colA'] },
76 { -desc => \[ 'colB LIKE ?', [ colB => 'test' ] ] },
77 { -asc => \[ 'colC LIKE ?', [ colC => 'tost' ] ] },
79 order_req => 'colA ASC, colB LIKE ? DESC, colC LIKE ? ASC',
80 bind => [ [ colB => 'test' ], [ colC => 'tost' ] ],
86 { -desc => { colB => { 'LIKE' => 'test' } } },
87 { -asc => { colC => { 'LIKE' => 'tost' } } }
89 order_req => 'colA ASC, colB LIKE ? DESC, colC LIKE ? ASC',
90 bind => [ [ colB => 'test' ], [ colC => 'tost' ] ],
94 order_by => { -desc => { colA => { LIKE => 'test' } } },
95 order_req => 'colA LIKE ? DESC',
96 bind => [ [ colA => 'test' ] ],
100 test_order($_) for @tests;