-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOC Document ORM changes for CMS 5.2 #351
DOC Document ORM changes for CMS 5.2 #351
Conversation
### silverstripe/framework | ||
### silverstripe/framework {#api-silverstripe-framework} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gives a unique anchor ID for this heading to distinguish it from the silverstripe/framework
heading that will be automatically generated in the actual changelog below this.
Not strictly necessary as part of this PR but it's a tiny change so I probably wouldn't bother with a separate PR.
3f2912f
to
34ed353
Compare
@@ -637,29 +637,98 @@ public function countDuplicates($model, $fieldToCheck) | |||
} | |||
``` | |||
|
|||
### Common Table Expressions (CTEs aka the `WITH` clause) {#cte} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm intentionally cramming the common three ways to refer to this functionality into the heading for search discovery purposes:
- "Common Table Expressions"
- "CTE"
- "WITH clause"
// Combine another query using a union | ||
$sqlQuery->addUnion($anotherSqlSelect, SQLSelect::UNION_ALL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've intentionally not added any more documentation than this for unions because I think the method is self-explanatory for anyone who knows what a union is and how it's used in SQL.
Frankly, anyone who doesn't understand the SQL concept of unions probably won't care about it anyway or have any reason to use it.
This is also roughly the same amount of documentation available for joins, which are arguably more complex to use as far as the API is concerned.
34ed353
to
3859d62
Compare
I left a review on silverstripe/silverstripe-framework#10943 - depending on that we may want to change stuff in this PR |
Rebased to resolve conflicts |
3859d62
to
02f1b10
Compare
There have been some changes in the code, but I'll hold off updating docs until that PR has been approved. |
02f1b10
to
261a51f
Compare
Updated docs to reflect the recent code changes, and to make some things slightly clearer. |
This PR includes
DataQuery::setAllowCollidingFieldStatements()
(in changelog only, but feel free to point out a good place for it if you think it deserves its own entry in the main docs somewhere)Note that the documentation here intentionally doesn't cover every scenario - the
08_SQL_Select.md
file already says that there's a lot in here and that people should check the PHPDoc for full usage details.Issue