IDEA(dbal): A set of interfaces for constructing queries #7562
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These interfaces allow us to construct most basic queries within Elgg
in a programmatic and safe way. Have not attempted to find out where
the more complicated entities queries could be converted to this,
but it does seem pretty generic and able to handle quite a range, so
I would be remiss not to try.
The major downside of all this of course is that it would be mostly custom
implementation. The main attempt at "innovation" is using pass-by-reference
to alias tables instead of strings. This guarantees that all aliases are unique
and allows you to refer to columns/tables in the query by references rather
than strings.
I didn't look outside of doctrine for a query builder interface but if you know any others that might be close to this, that would be appreciated. Hopefully there is enough documentation here to give the gist of the API and generate some good discussion.