Add docs for a few functions
Signed-off-by: David Arendsen <darendsen@gamepoint.com>
This commit is contained in:
parent
83ed120d5d
commit
7a70c361c9
8 changed files with 227 additions and 12 deletions
2
LICENSE
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) David Arendsen
|
Copyright (c) 2022 - 2023 David Arendsen
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,14 @@
|
||||||
|
|
||||||
On this page you will find the methods you can use in the query builder.
|
On this page you will find the methods you can use in the query builder.
|
||||||
|
|
||||||
|
* [from()](functions/from.md)
|
||||||
|
* [fromBucket()](functions/fromBucket.md)
|
||||||
|
* [fromMeasurement()](functions/fromMeasurement.md)
|
||||||
* [addAggregateWindow()](functions/addAggregateWindow.md)
|
* [addAggregateWindow()](functions/addAggregateWindow.md)
|
||||||
* [addDuplicate()](functions/addDuplicate.md)
|
* [addDuplicate()](functions/addDuplicate.md)
|
||||||
* [addGroup()](functions/addGroup.md)
|
* [addGroup()](functions/addGroup.md)
|
||||||
* [addLimit()](functions/addLimit.md)
|
* [addLimit()](functions/addLimit.md)
|
||||||
* [addMean()](functions/addMean.md)
|
* [addMean()](functions/addMean.md)
|
||||||
* [addRange()](functions/addRange.md)
|
* [addRangeStart()](functions/addRangeStart.md)
|
||||||
|
* [addRangeInBetween()](functions/addRangeInBetween.md)
|
||||||
* [addRawFunction()](functions/addRawFunction.md)
|
* [addRawFunction()](functions/addRawFunction.md)
|
||||||
51
docs/functions/addRangeInBetween.md
Normal file
51
docs/functions/addRangeInBetween.md
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
# Flux Query Builder Docs
|
||||||
|
|
||||||
|
## Functions » addRangeInBetween()
|
||||||
|
|
||||||
|
### Parameters:
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Required</th>
|
||||||
|
<th>Data type</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>start</td>
|
||||||
|
<td>Yes</td>
|
||||||
|
<td>DateTime</td>
|
||||||
|
<td>Earliest time to include in results.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>stop</td>
|
||||||
|
<td>Yes</td>
|
||||||
|
<td>DateTime</td>
|
||||||
|
<td>Latest time to include in results. Default is the current time.</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```php
|
||||||
|
->addRangeInBetween(
|
||||||
|
new DateTime('2022-08-12 18:00:00'),
|
||||||
|
new DateTime('2022-08-12 20:00:00')
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
This will result in the following Flux function part:
|
||||||
|
|
||||||
|
```
|
||||||
|
|> range(
|
||||||
|
start: time(v: 2022-08-12T18:00:00Z),
|
||||||
|
stop: time(v: 2022-08-12T20:00:00Z)
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Extra resources
|
||||||
|
|
||||||
|
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/range/)
|
||||||
43
docs/functions/addRangeStart.md
Normal file
43
docs/functions/addRangeStart.md
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
# Flux Query Builder Docs
|
||||||
|
|
||||||
|
## Functions » addRangeStart()
|
||||||
|
|
||||||
|
### Parameters:
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Required</th>
|
||||||
|
<th>Data type</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>start</td>
|
||||||
|
<td>Yes</td>
|
||||||
|
<td>DateTime</td>
|
||||||
|
<td>Earliest time to include in results.</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```php
|
||||||
|
->addRangeStart(
|
||||||
|
new DateTime('2022-08-12 18:00:00')
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
This will result in the following Flux function part:
|
||||||
|
|
||||||
|
```
|
||||||
|
|> range(
|
||||||
|
start: time(v: 2022-08-12T18:00:00Z)
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Extra resources
|
||||||
|
|
||||||
|
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/range/)
|
||||||
49
docs/functions/from.md
Normal file
49
docs/functions/from.md
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
# Flux Query Builder Docs
|
||||||
|
|
||||||
|
## Functions » from()
|
||||||
|
|
||||||
|
### Parameters:
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Required</th>
|
||||||
|
<th>Data type</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>settings</td>
|
||||||
|
<td>Yes</td>
|
||||||
|
<td>array</td>
|
||||||
|
<td>Settings to retrieve a data source.</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```php
|
||||||
|
->from([
|
||||||
|
'bucket' => 'test_bucket',
|
||||||
|
'host' => 'https://us-west-2-1.aws.cloud2.influxdata.com',
|
||||||
|
'org' => 'example-org',
|
||||||
|
'token' => 'token'
|
||||||
|
])
|
||||||
|
```
|
||||||
|
|
||||||
|
This will result in the following Flux function part:
|
||||||
|
|
||||||
|
```
|
||||||
|
|> from(
|
||||||
|
bucket: "test_bucket",
|
||||||
|
host: "https://us-west-2-1.aws.cloud2.influxdata.com",
|
||||||
|
org: "example-org",
|
||||||
|
token: "token",
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Extra resources
|
||||||
|
|
||||||
|
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/from/)
|
||||||
39
docs/functions/fromBucket.md
Normal file
39
docs/functions/fromBucket.md
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
# Flux Query Builder Docs
|
||||||
|
|
||||||
|
## Functions » fromBucket()
|
||||||
|
|
||||||
|
### Parameters:
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Required</th>
|
||||||
|
<th>Data type</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>bucket</td>
|
||||||
|
<td>Yes</td>
|
||||||
|
<td>string</td>
|
||||||
|
<td>The bucket you want to retrieve data from.</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```php
|
||||||
|
->fromBucket('test_bucket')
|
||||||
|
```
|
||||||
|
|
||||||
|
This will result in the following Flux function part:
|
||||||
|
|
||||||
|
```
|
||||||
|
|> from(bucket: "test_bucket")
|
||||||
|
```
|
||||||
|
|
||||||
|
### Extra resources
|
||||||
|
|
||||||
|
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/from/)
|
||||||
39
docs/functions/fromMeasurement.md
Normal file
39
docs/functions/fromMeasurement.md
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
# Flux Query Builder Docs
|
||||||
|
|
||||||
|
## Functions » fromMeasurement()
|
||||||
|
|
||||||
|
### Parameters:
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Required</th>
|
||||||
|
<th>Data type</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>measurement</td>
|
||||||
|
<td>Yes</td>
|
||||||
|
<td>string</td>
|
||||||
|
<td>The measurement to filter on.</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```php
|
||||||
|
->fromMeasurement('test_measurement')
|
||||||
|
```
|
||||||
|
|
||||||
|
This will result in the following Flux function part:
|
||||||
|
|
||||||
|
```
|
||||||
|
|> filter(fn: (r) => r._measurement == "test_measurement")
|
||||||
|
```
|
||||||
|
|
||||||
|
### Extra resources
|
||||||
|
|
||||||
|
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/filter/)
|
||||||
|
|
@ -7,19 +7,9 @@ use Exception;
|
||||||
use Arendsen\FluxQueryBuilder\Builder\FluxPart;
|
use Arendsen\FluxQueryBuilder\Builder\FluxPart;
|
||||||
use Arendsen\FluxQueryBuilder\Expression\KeyValue;
|
use Arendsen\FluxQueryBuilder\Expression\KeyValue;
|
||||||
use Arendsen\FluxQueryBuilder\Expression\KeyFilter;
|
use Arendsen\FluxQueryBuilder\Expression\KeyFilter;
|
||||||
use Arendsen\FluxQueryBuilder\Functions\AggregateWindow;
|
|
||||||
use Arendsen\FluxQueryBuilder\Functions\Duplicate;
|
|
||||||
use Arendsen\FluxQueryBuilder\Functions\Filter;
|
use Arendsen\FluxQueryBuilder\Functions\Filter;
|
||||||
use Arendsen\FluxQueryBuilder\Functions\From;
|
use Arendsen\FluxQueryBuilder\Functions\From;
|
||||||
use Arendsen\FluxQueryBuilder\Functions\Range;
|
use Arendsen\FluxQueryBuilder\Functions\Range;
|
||||||
use Arendsen\FluxQueryBuilder\Functions\Reduce;
|
|
||||||
use Arendsen\FluxQueryBuilder\Functions\Sort;
|
|
||||||
use Arendsen\FluxQueryBuilder\Functions\Map;
|
|
||||||
use Arendsen\FluxQueryBuilder\Functions\Group;
|
|
||||||
use Arendsen\FluxQueryBuilder\Functions\Limit;
|
|
||||||
use Arendsen\FluxQueryBuilder\Functions\Mean;
|
|
||||||
use Arendsen\FluxQueryBuilder\Functions\RawFunction;
|
|
||||||
use Arendsen\FluxQueryBuilder\Functions\Window;
|
|
||||||
|
|
||||||
abstract class AbstractQueryBuilder
|
abstract class AbstractQueryBuilder
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue