- Fixed the missing DISTINCT keyword while rendering select()

- Added a fragment remover in Repository
This commit is contained in:
mcndave committed 2021-03-01 16:10:15 +00:00
1 parent 8f9332fbad
commit e7d5d5965b
2 files changed
+17 -1

No files matched your search

+2 -1
View File
@@ -17,7 +17,7 @@ class Select extends Fragment {
protected array $fields = [];
const SQL_TOKEN = "SELECT";
public function set($fields) : self
{
$this->fields = is_array($fields) ? $fields : [ $fields ];
@@ -48,6 +48,7 @@ class Select extends Fragment {
return $this->renderSegments([
( $this->union ? 'UNION' : false ),
static::SQL_TOKEN,
( $this->distinct ? 'DISTINCT' : false ),
( $this->top ? sprintf('TOP (%s)', $this->top) : false ),
implode(', ', $this->fields)
]);