shall use leftJoin by default and support on clause
See original GitHub issueshall use leftJoin
by default and use innerJoin
by config
see sequelize
options include.required
behavior
If the relation can be set NULL
, innerJoin
will break the query.
refer: http://docs.sequelizejs.com/class/lib/model.js~Model.html#static-method-findAll
Name Type Attribute Description options.include[].required boolean optional If true, converts to an inner join, which means that the parent model will only be loaded if it has any matching children. True if include.where is set, false otherwise.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:12 (5 by maintainers)
Top Results From Across the Web
SQL Join clause introduction and overview - SQLShack
If you just specify Join, then by default it is an Inner join; An Outer join must be Left/Right/Full. You cannot just say...
Read more >SQL JOIN - WHERE clause vs. ON clause - Stack Overflow
For INNER JOIN the answer is yes since an INNER JOIN statement can be rewritten as a CROSS JOIN with a WHERE clause...
Read more >Understanding MySQL LEFT JOIN Clause By Examples
In other words, LEFT JOIN returns all rows from the left table regardless of whether a row from the left table has a...
Read more >LEFT JOIN, RIGHT JOIN operations (Microsoft Access SQL)
Left outer joins include all of the records from the first (left) of two tables, even if there are no matching values for...
Read more >JOIN clause
That means that only rows for which the join condition is TRUE are included. If you do not specify the join type, JOIN...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Diluka @macchie this will have a high priority on the next release.
You do this PR is better. I need to take the time to familiarize myself with this new architecture.
When using left join and the relation can be set
null
, the same condition put inon
orwhere
can be different result.p.s. I feel that it will become more and more complicated here.