Skip to content

Commit

Permalink
Merge pull request #67 from singlestore-labs/ISSUE-64
Browse files Browse the repository at this point in the history
Modified generation of the union queries
  • Loading branch information
AdalbertMemSQL authored Aug 8, 2023
2 parents bee2c30 + 949ffec commit de5f662
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Query/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,18 @@ protected function compileUnions(Builder $query)
return ltrim($sql);
}

/**
* Compile a single union statement.
*
* @return string
*/
protected function compileUnion(array $union)
{
$conjunction = $union['all'] ? ' union all ' : ' union ';

return $conjunction.'('.$union['query']->toSql().')';
}

/**
* Compile a select query into SQL.
*
Expand Down

0 comments on commit de5f662

Please sign in to comment.