File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,5 +11,8 @@ var JoinNode = module.exports = require(__dirname).define({
1111 } ,
1212 join : function ( other ) {
1313 return new JoinNode ( 'INNER' , this , other ) ;
14+ } ,
15+ leftJoin : function ( other ) {
16+ return new JoinNode ( 'LEFT' , this , other ) ;
1417 }
1518} ) ;
Original file line number Diff line number Diff line change @@ -25,6 +25,18 @@ Harness.test({
2525 pg : 'SELECT "user"."name", "post"."content" FROM "user" LEFT JOIN "post" ON ("user"."id" = "post"."userId")'
2626} ) ;
2727
28+ Harness . test ( {
29+ query : user
30+ . select ( user . name , post . content )
31+ . from (
32+ user
33+ . leftJoin ( post ) . on ( user . id . equals ( post . userId ) )
34+ . leftJoin ( comment ) . on ( post . id . equals ( comment . postId ) )
35+ ) ,
36+ pg : 'SELECT "user"."name", "post"."content" FROM "user" LEFT JOIN "post" ON ("user"."id" = "post"."userId")' +
37+ ' LEFT JOIN "comment" ON ("post"."id" = "comment"."postId")'
38+ } ) ;
39+
2840Harness . test ( {
2941 query : user
3042 . select ( user . name , post . content )
You can’t perform that action at this time.
0 commit comments