Add unwindow function to Query Builder

Signed-off-by: davidarendsen <davidarendsen@hey.com>
This commit is contained in:
davidarendsen 2022-09-01 09:16:38 +00:00
commit 68ae5f2760
2 changed files with 35 additions and 3 deletions

View file

@ -26,17 +26,19 @@ class QueryBuilder
public const FLUX_PART_GROUP = 'group';
public const FLUX_PART_LIMIT = 'limit';
public const FLUX_PART_WINDOW = 'window';
public const FLUX_PART_UNWINDOW = 'unwindow';
public const PARTS = [
self::FLUX_PART_FROM,
self::FLUX_PART_RANGE,
self::FLUX_PART_REDUCE,
self::FLUX_PART_WINDOW,
self::FLUX_PART_FILTERS,
self::FLUX_PART_MAP,
self::FLUX_PART_SORT,
self::FLUX_PART_WINDOW,
self::FLUX_PART_GROUP,
self::FLUX_PART_LIMIT,
self::FLUX_PART_UNWINDOW,
];
public const REQUIRED_INPUT_FROM = 'from';
@ -187,6 +189,15 @@ class QueryBuilder
return $this;
}
public function addUnWindow()
{
$this->addToQueryArray(
self::FLUX_PART_UNWINDOW,
new Window('inf')
);
return $this;
}
protected function addToQuery($key, $query)
{
$this->fluxQueryParts[$key] = $query;