7 require DBIx::Class::Optional::Dependencies;
8 plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('id_shortener')
9 unless DBIx::Class::Optional::Dependencies->req_ok_for ('id_shortener');
14 use DBIx::Class::SQLMaker::OracleJoins;
15 use DBIC::SqlMakerTest;
17 my $sa = DBIx::Class::SQLMaker::OracleJoins->new;
19 # my ($self, $table, $fields, $where, $order, @rest) = @_;
20 my ($sql, @bind) = $sa->select(
24 { "-join_type" => "LEFT", artist => "artist" },
25 { "artist.artistid" => "me.artist" },
28 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
34 'SELECT cd.cdid, cd.artist, cd.title, cd.year, artist.artistid, artist.name FROM cd me, artist artist WHERE ( artist.artistid(+) = me.artist )', [],
35 'WhereJoins search with empty where clause'
38 ($sql, @bind) = $sa->select(
42 { "-join_type" => "", artist => "artist" },
43 { "artist.artistid" => "me.artist" },
46 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
47 { 'artist.artistid' => 3 },
52 '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],
53 'WhereJoins search with where clause'
56 ($sql, @bind) = $sa->select(
60 { "-join_type" => "LEFT", artist => "artist" },
61 { "artist.artistid" => "me.artist" },
64 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
65 [{ 'artist.artistid' => 3 }, { 'me.cdid' => 5 }],
70 '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],
71 'WhereJoins search with or in where clause'