- Added the HAVING and TRUNCATE keyword

- Fixed GroupBy which was not implemented yet
- Added a new SQL raw() function
- From statement now accepts subqueries
This commit is contained in:
Dave Mc Nicoll committed 2020-10-06 11:00:12 -04:00
1 parent 538af38769
commit 139504f8dd
17 files changed
+566 -251

No files matched your search

+3 -3
View File
@@ -50,14 +50,14 @@ class Where extends Fragment {
return $this;
}
public function render() : string
public function render(bool $skipToken = false) : string
{
$stack = [];
foreach ($this->conditionList ?? [] as $key => $item) {
if ( $item instanceof Where ) {
if ( $item->conditionList ?? false ) {
$stack[] = ( $key !== 0 ? "{$item->condition} " : "" ) . "(" . $item->render() . ")";
$stack[] = ( $key !== 0 ? "{$item->condition} " : "" ) . "(" . $item->render($skipToken) . ")";
}
}
else {
@@ -67,7 +67,7 @@ class Where extends Fragment {
}
return $this->renderSegments([
! $this->parent ? static::SQL_TOKEN : "",
! $this->parent && ! $skipToken ? static::SQL_TOKEN : "",
implode(" ", $stack)
]);
}