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');
13 use DBICTest ':DiffSQL';
14 use DBIx::Class::SQLMaker::OracleJoins;
16 my $sa = DBIx::Class::SQLMaker::OracleJoins->new;
18 # my ($self, $table, $fields, $where, $order, @rest) = @_;
19 my ($sql, @bind) = $sa->select(
23 { "-join_type" => "LEFT", artist => "artist" },
24 { "artist.artistid" => "me.artist" },
27 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
33 'SELECT cd.cdid, cd.artist, cd.title, cd.year, artist.artistid, artist.name FROM cd me, artist artist WHERE ( artist.artistid(+) = me.artist )', [],
34 'WhereJoins search with empty where clause'
37 ($sql, @bind) = $sa->select(
41 { "-join_type" => "", artist => "artist" },
42 { "artist.artistid" => "me.artist" },
45 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
46 { 'artist.artistid' => 3 },
51 '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],
52 'WhereJoins search with where clause'
55 ($sql, @bind) = $sa->select(
59 { "-join_type" => "LEFT", artist => "artist" },
60 { "artist.artistid" => "me.artist" },
63 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
64 [{ 'artist.artistid' => 3 }, { 'me.cdid' => 5 }],
69 '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],
70 'WhereJoins search with or in where clause'