7 use DBIx::Class::SQLAHacks::OracleJoins;
9 use DBIC::SqlMakerTest;
11 my $sa = new DBIx::Class::SQLAHacks::OracleJoins;
13 # search with undefined or empty $cond
15 # my ($self, $table, $fields, $where, $order, @rest) = @_;
16 my ($sql, @bind) = $sa->select(
20 { "-join_type" => "LEFT", artist => "artist" },
21 { "artist.artistid" => "me.artist" },
24 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
30 'SELECT cd.cdid, cd.artist, cd.title, cd.year, artist.artistid, artist.name FROM cd me, artist artist WHERE ( artist.artistid(+) = me.artist )', [],
31 'WhereJoins search with empty where clause'
34 ($sql, @bind) = $sa->select(
38 { "-join_type" => "", artist => "artist" },
39 { "artist.artistid" => "me.artist" },
42 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
43 { 'artist.artistid' => 3 },
48 'SELECT cd.cdid, cd.artist, cd.title, cd.year, artist.artistid, artist.name FROM cd me, artist artist WHERE ( ( ( artist.artistid = me.artist ) AND ( artist.artistid = ? ) ) )', [3],
49 'WhereJoins search with where clause'
52 ($sql, @bind) = $sa->select(
56 { "-join_type" => "LEFT", artist => "artist" },
57 { "artist.artistid" => "me.artist" },
60 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
61 [{ 'artist.artistid' => 3 }, { 'me.cdid' => 5 }],
66 'SELECT cd.cdid, cd.artist, cd.title, cd.year, artist.artistid, artist.name FROM cd me, artist artist WHERE ( ( ( artist.artistid(+) = me.artist ) AND ( ( ( artist.artistid = ? ) OR ( me.cdid = ? ) ) ) ) )', [3, 5],
67 'WhereJoins search with or in where clause'