Skip to content

Commit

Permalink
Merge pull request #25816 from nextcloud/iquerybuilder-join-conditions
Browse files Browse the repository at this point in the history
allow non string join conditions in query builder
  • Loading branch information
nickvergessen authored Mar 3, 2021
2 parents 74f3617 + 47dd8e5 commit 11858a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions lib/private/DB/QueryBuilder/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
use OC\DB\ResultAdapter;
use OC\SystemConfig;
use OCP\DB\IResult;
use OCP\DB\QueryBuilder\ICompositeExpression;
use OCP\DB\QueryBuilder\ILiteral;
use OCP\DB\QueryBuilder\IParameter;
use OCP\DB\QueryBuilder\IQueryBuilder;
Expand Down Expand Up @@ -282,7 +283,7 @@ public function execute() {
'app' => 'core',
]);
}

$result = $this->queryBuilder->execute();
if (is_int($result)) {
return $result;
Expand Down Expand Up @@ -664,7 +665,7 @@ public function from($from, $alias = null) {
* @param string $fromAlias The alias that points to a from clause.
* @param string $join The table name to join.
* @param string $alias The alias of the join table.
* @param string $condition The condition for the join.
* @param string|ICompositeExpression|null $condition The condition for the join.
*
* @return $this This QueryBuilder instance.
*/
Expand Down Expand Up @@ -692,7 +693,7 @@ public function join($fromAlias, $join, $alias, $condition = null) {
* @param string $fromAlias The alias that points to a from clause.
* @param string $join The table name to join.
* @param string $alias The alias of the join table.
* @param string $condition The condition for the join.
* @param string|ICompositeExpression|null $condition The condition for the join.
*
* @return $this This QueryBuilder instance.
*/
Expand Down Expand Up @@ -720,7 +721,7 @@ public function innerJoin($fromAlias, $join, $alias, $condition = null) {
* @param string $fromAlias The alias that points to a from clause.
* @param string $join The table name to join.
* @param string $alias The alias of the join table.
* @param string $condition The condition for the join.
* @param string|ICompositeExpression|null $condition The condition for the join.
*
* @return $this This QueryBuilder instance.
*/
Expand Down Expand Up @@ -748,7 +749,7 @@ public function leftJoin($fromAlias, $join, $alias, $condition = null) {
* @param string $fromAlias The alias that points to a from clause.
* @param string $join The table name to join.
* @param string $alias The alias of the join table.
* @param string $condition The condition for the join.
* @param string|ICompositeExpression|null $condition The condition for the join.
*
* @return $this This QueryBuilder instance.
*/
Expand Down
8 changes: 4 additions & 4 deletions lib/public/DB/QueryBuilder/IQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ public function from($from, $alias = null);
* @param string $fromAlias The alias that points to a from clause.
* @param string $join The table name to join.
* @param string $alias The alias of the join table.
* @param string $condition The condition for the join.
* @param string|ICompositeExpression|null $condition The condition for the join.
*
* @return $this This QueryBuilder instance.
* @since 8.2.0
Expand All @@ -496,7 +496,7 @@ public function join($fromAlias, $join, $alias, $condition = null);
* @param string $fromAlias The alias that points to a from clause.
* @param string $join The table name to join.
* @param string $alias The alias of the join table.
* @param string $condition The condition for the join.
* @param string|ICompositeExpression|null $condition The condition for the join.
*
* @return $this This QueryBuilder instance.
* @since 8.2.0
Expand All @@ -521,7 +521,7 @@ public function innerJoin($fromAlias, $join, $alias, $condition = null);
* @param string $fromAlias The alias that points to a from clause.
* @param string $join The table name to join.
* @param string $alias The alias of the join table.
* @param string $condition The condition for the join.
* @param string|ICompositeExpression|null $condition The condition for the join.
*
* @return $this This QueryBuilder instance.
* @since 8.2.0
Expand All @@ -546,7 +546,7 @@ public function leftJoin($fromAlias, $join, $alias, $condition = null);
* @param string $fromAlias The alias that points to a from clause.
* @param string $join The table name to join.
* @param string $alias The alias of the join table.
* @param string $condition The condition for the join.
* @param string|ICompositeExpression|null $condition The condition for the join.
*
* @return $this This QueryBuilder instance.
* @since 8.2.0
Expand Down

0 comments on commit 11858a3

Please sign in to comment.