6 use DBIC::SqlMakerTest;
8 use DBIx::Class::SQLMaker::ACCESS ();
10 my $sa = DBIx::Class::SQLMaker::ACCESS->new;
12 # my ($self, $table, $fields, $where, $order, @rest) = @_;
13 my ($sql, @bind) = $sa->select(
17 { "-join_type" => "LEFT", artist => "artist" },
18 { "artist.artistid" => "me.artist" },
21 [ 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
27 'SELECT cd.cdid, cd.artist, cd.title, cd.year, artist.artistid, artist.name FROM (cd me LEFT JOIN artist artist ON artist.artistid = me.artist)', [],
28 'one-step join parenthesized'
31 ($sql, @bind) = $sa->select(
35 { "-join_type" => "LEFT", track => "track" },
36 { "track.cd" => "me.cdid" },
39 { artist => "artist" },
40 { "artist.artistid" => "me.artist" },
43 [ 'track.title', 'cd.cdid', 'cd.artist', 'cd.title', 'cd.year', 'artist.artistid', 'artist.name' ],
49 'SELECT track.title, cd.cdid, cd.artist, cd.title, cd.year, artist.artistid, artist.name FROM ((cd me LEFT JOIN track track ON track.cd = me.cdid) INNER JOIN artist artist ON artist.artistid = me.artist)', [],
50 'two-step join parenthesized and inner join prepended with INNER'