8 use DBIC::SqlMakerTest;
10 my $schema = DBICTest->init_schema;
12 my $rs = $schema->resultset('FourKeys');
19 local $TODO = "Not implemented" if $args->{todo};
26 order_by => $args->{order_by},
28 [ { read_count => { '>' => 5 } }, \[ 'read_count < ?', 8 ] ]
32 SELECT me.foo, me.bar, me.hello, me.goodbye, me.sensors, me.read_count
35 HAVING read_count > ? OR read_count < ?
36 ORDER BY $args->{order_req}
48 fail('Fail the unfinished is_same_sql_bind') if $@;
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 ?', 'test' ] },
65 order_req => 'colA LIKE ? DESC',
69 order_by => \[ 'colA LIKE ? DESC', 'test' ],
70 order_req => 'colA LIKE ? DESC',
75 { -asc => \['colA'] },
76 { -desc => \[ 'colB LIKE ?', 'test' ] },
77 { -asc => \[ 'colC LIKE ?', 'tost' ] }
79 order_req => 'colA ASC, colB LIKE ? DESC, colC LIKE ? ASC',
80 bind => [qw(test tost)],
83 # (mo) this would be really really nice!
84 # (ribasushi) I don't think so, not writing it - patches welcome
88 { -desc => { colB => { 'LIKE' => 'test' } } },
89 { -asc => { colC => { 'LIKE' => 'tost' } } }
91 order_req => 'colA ASC, colB LIKE ? DESC, colC LIKE ? ASC',
92 bind => [ [ colB => 'test' ], [ colC => 'tost' ] ], # ???
96 order_by => { -desc => { colA => { LIKE => 'test' } } },
97 order_req => 'colA LIKE ? DESC',
103 plan( tests => scalar @tests * 2 );
105 test_order($_) for @tests;