-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* base content for influxdb3 query guides * added enterprise versions of query guides * Apply suggestions from code review Co-authored-by: Jason Stirnaman <[email protected]> * update template titles to use .RenderString --------- Co-authored-by: Jason Stirnaman <[email protected]>
- Loading branch information
1 parent
824b2f8
commit 86bee7c
Showing
84 changed files
with
4,564 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: Query data in {{< product-name >}} | ||
description: > | ||
Learn to query data stored in InfluxDB using SQL and InfluxQL. | ||
menu: | ||
influxdb3_core: | ||
name: Query data | ||
weight: 4 | ||
influxdb3/core/tags: [query] | ||
source: /shared/influxdb3-query-guides/_index.md | ||
--- | ||
|
||
<!-- | ||
The content for this page is at content/shared/influxdb3-query-guides/_index.md | ||
--> |
20 changes: 20 additions & 0 deletions
20
content/influxdb3/core/query-data/execute-queries/_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: Execute queries | ||
description: > | ||
Use tools and libraries to query data stored in {{< product-name >}}. | ||
weight: 101 | ||
menu: | ||
influxdb3_core: | ||
name: Execute queries | ||
parent: Query data | ||
influxdb3/core/tags: [query, sql, influxql] | ||
aliases: | ||
- /influxdb3/core/query-data/tools/ | ||
- /influxdb3/core/query-data/sql/execute-queries/ | ||
- /influxdb3/core/query-data/influxql/execute-queries/ | ||
source: /shared/influxdb3-query-guides/execute-queries/_index.md | ||
--- | ||
|
||
<!-- | ||
The content for this page is at content/shared/influxdb3-query-guides/execute-queries/_index.md | ||
--> |
31 changes: 31 additions & 0 deletions
31
content/influxdb3/core/query-data/execute-queries/influxdb-v1-api.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: Use the InfluxDB v1 HTTP query API and InfluxQL to query data | ||
seotitle: Use InfluxQL and InfluxDB v1 HTTP query API | ||
list_title: Use the v1 query API and InfluxQL | ||
description: > | ||
Use the InfluxDB v1 HTTP query API to query data in {{< product-name >}} | ||
with InfluxQL. | ||
weight: 302 | ||
menu: | ||
influxdb3_core: | ||
parent: Execute queries | ||
name: Use the v1 query API | ||
influxdb3/core/tags: [query, influxql, python] | ||
metadata: [InfluxQL] | ||
related: | ||
- /influxdb3/core/api-compatibility/v1/ | ||
aliases: | ||
- /influxdb3/core/query-data/influxql/execute-queries/influxdb-v1-api/ | ||
list_code_example: | | ||
```sh | ||
curl --get http://{{< influxdb/host >}}/query \ | ||
--header "Authorization: Token DATABASE_TOKEN" \ | ||
--data-urlencode "db=DATABASE_NAME" \ | ||
--data-urlencode "q=SELECT * FROM home" | ||
``` | ||
source: /shared/influxdb3-query-guides/execute-queries/influxdb-v1-api.md | ||
--- | ||
|
||
<!-- | ||
The content for this page is at content/shared/influxdb3-query-guides/execute-queries/influxdb-v1-api.md | ||
--> |
28 changes: 28 additions & 0 deletions
28
content/influxdb3/core/query-data/execute-queries/influxdb3-cli.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: Use the influxdb3 CLI to query data | ||
list_title: Use the influxdb3 CLI | ||
description: > | ||
Use the `influxdb3 query` command to query data in {{< product-name >}} with SQL. | ||
weight: 301 | ||
menu: | ||
influxdb3_core: | ||
parent: Execute queries | ||
name: Use the influxdb3 CLI | ||
influxdb3/core/tags: [query, sql, influxql, influxdb3, CLI] | ||
related: | ||
- /influxdb3/core/reference/cli/influxdb3/query/ | ||
- /influxdb3/core/reference/sql/ | ||
- /influxdb3/core/reference/influxql/ | ||
# - /influxdb3/core/get-started/query/#execute-an-sql-query, Get started querying data | ||
list_code_example: | | ||
```sh | ||
influxdb3 query \ | ||
--database DATABASE_NAME \ | ||
"SELECT * FROM home" | ||
``` | ||
source: /shared/influxdb3-query-guides/execute-queries/influxdb3-cli.md | ||
--- | ||
|
||
<!-- | ||
The content for this page is at content/shared/influxdb3-query-guides/execute-queries/influxdb3-cli.md | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
title: Query data with InfluxQL | ||
description: > | ||
Learn to use InfluxQL to query data stored in {{< product-name >}}. | ||
menu: | ||
influxdb3_core: | ||
name: Query with InfluxQL | ||
parent: Query data | ||
weight: 102 | ||
influxdb3/core/tags: [query, influxql] | ||
source: /shared/influxdb3-query-guides/influxql/_index.md | ||
--- | ||
|
||
<!-- | ||
The content for this page is at content/shared/influxdb3-query-guides/influxql/_index.md | ||
--> |
41 changes: 41 additions & 0 deletions
41
content/influxdb3/core/query-data/influxql/aggregate-select.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
title: Aggregate data with InfluxQL | ||
seotitle: Aggregate or apply selector functions to data with InfluxQL | ||
description: > | ||
Use InfluxQL aggregate and selector functions to perform aggregate operations | ||
on your time series data. | ||
menu: | ||
influxdb3_core: | ||
name: Aggregate data | ||
parent: Query with InfluxQL | ||
identifier: query-influxql-aggregate | ||
weight: 203 | ||
influxdb3/core/tags: [query, influxql] | ||
related: | ||
- /influxdb3/core/reference/influxql/functions/aggregates/ | ||
- /influxdb3/core/reference/influxql/functions/selectors/ | ||
list_code_example: | | ||
##### Aggregate fields by groups | ||
```sql | ||
SELECT | ||
MEAN(temp) AS mean, | ||
FIRST(hum) as first, | ||
FROM home | ||
GROUP BY tag | ||
``` | ||
##### Aggregate by time-based intervals | ||
```sql | ||
SELECT | ||
MEAN(temp), | ||
sum(hum), | ||
FROM home | ||
WHERE time >= now() - 24h | ||
GROUP BY time(1h),room | ||
``` | ||
source: /shared/influxdb3-query-guides/influxql/aggregate-select.md | ||
--- | ||
|
||
<!-- | ||
The content for this page is at content/shared/influxdb3-query-guides/influxql/aggregate-select.md | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
title: Perform a basic InfluxQL query | ||
seotitle: Perform a basic InfluxQL query in {{< product-name >}} | ||
description: > | ||
A basic InfluxQL query that queries data from InfluxDB most commonly includes | ||
`SELECT`, `FROM`, and `WHERE` clauses. | ||
menu: | ||
influxdb3_core: | ||
name: Basic query | ||
parent: Query with InfluxQL | ||
identifier: query-influxql-basic | ||
weight: 202 | ||
influxdb3/core/tags: [query, influxql] | ||
list_code_example: | | ||
```sql | ||
SELECT temp, room FROM home WHERE time >= now() - 1d | ||
``` | ||
source: /shared/influxdb3-query-guides/influxql/basic-query.md | ||
--- | ||
|
||
<!-- | ||
The content for this page is at content/shared/influxdb3-query-guides/influxql/basic-query.md | ||
--> |
39 changes: 39 additions & 0 deletions
39
content/influxdb3/core/query-data/influxql/explore-schema.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
title: Explore your schema with InfluxQL | ||
description: > | ||
Use InfluxQL `SHOW` statements to return information about your data schema. | ||
menu: | ||
influxdb3_core: | ||
name: Explore your schema | ||
parent: Query with InfluxQL | ||
identifier: query-influxql-schema | ||
weight: 201 | ||
influxdb3/core/tags: [query, influxql] | ||
related: | ||
- /influxdb3/core/reference/influxql/show/ | ||
list_code_example: | | ||
##### List measurements | ||
```sql | ||
SHOW MEASUREMENTS | ||
``` | ||
##### List field keys in a measurement | ||
```sql | ||
SHOW FIELD KEYS FROM "measurement" | ||
``` | ||
##### List tag keys in a measurement | ||
```sql | ||
SHOW TAG KEYS FROM "measurement" | ||
``` | ||
##### List tag values for a specific tag key | ||
```sql | ||
SHOW TAG VALUES FROM "measurement" WITH KEY = "tag-key" WHERE time > now() - 1d | ||
``` | ||
source: /shared/influxdb3-query-guides/influxql/explore-schema.md | ||
--- | ||
|
||
<!-- | ||
The content for this page is at content/shared/influxdb3-query-guides/influxql/explore-schema.md | ||
--> |
45 changes: 45 additions & 0 deletions
45
content/influxdb3/core/query-data/influxql/parameterized-queries.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: Use parameterized queries with InfluxQL | ||
description: > | ||
Use parameterized queries to prevent injection attacks and make queries more reusable. | ||
weight: 404 | ||
menu: | ||
influxdb3_core: | ||
name: Parameterized queries | ||
parent: Query with InfluxQL | ||
identifier: parameterized-queries-influxql | ||
influxdb3/core/tags: [query, security, influxql] | ||
list_code_example: | | ||
##### Using Go and the influxdb3-go client | ||
```go | ||
// Use the $parameter syntax to reference parameters in a query. | ||
// The following InfluxQL query contains $room and $min_time parameters. | ||
query := ` | ||
SELECT * FROM home | ||
WHERE time >= $min_time | ||
AND temp >= $min_temp | ||
AND room = $room` | ||
// Assign parameter names to input values. | ||
parameters := influxdb3.QueryParameters{ | ||
"room": "Kitchen", | ||
"min_temp": 20.0, | ||
"min_time": "2024-03-18 00:00:00.00", | ||
} | ||
// Call the client's function to query InfluxDB with parameters and the | ||
// the InfluxQL QueryType. | ||
iterator, err := client.QueryWithParameters(context.Background(), | ||
query, | ||
parameters, | ||
influxdb3.WithQueryType(influxdb3.InfluxQL)) | ||
``` | ||
# Leaving in draft until tested | ||
draft: true | ||
source: /shared/influxdb3-query-guides/influxql/parameterized-queries.md | ||
--- | ||
|
||
<!-- | ||
The content for this page is at content/shared/influxdb3-query-guides/influxql/parameterized-queries.md | ||
--> |
15 changes: 15 additions & 0 deletions
15
content/influxdb3/core/query-data/influxql/troubleshoot.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: Troubleshoot InfluxQL errors | ||
description: > | ||
Learn how to troubleshoot and fix common InfluxQL errors. | ||
menu: | ||
influxdb3_core: | ||
name: Troubleshoot errors | ||
parent: Query with InfluxQL | ||
weight: 230 | ||
source: /shared/influxdb3-query-guides/influxql/troubleshoot.md | ||
--- | ||
|
||
<!-- | ||
The content for this page is at content/shared/influxdb3-query-guides/influxql/troubleshoot.md | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: Query data with SQL | ||
seotitle: Query data with SQL | ||
description: > | ||
Learn to query data stored in {{< product-name >}} using SQL. | ||
menu: | ||
influxdb3_core: | ||
name: Query with SQL | ||
parent: Query data | ||
weight: 101 | ||
influxdb3/core/tags: [query, sql] | ||
source: /shared/influxdb3-query-guides/sql/_index.md | ||
--- | ||
|
||
<!-- | ||
The content for this page is at content/shared/influxdb3-query-guides/sql/_index.md | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
title: Aggregate data with SQL | ||
description: > | ||
Use aggregate and selector functions to perform aggregate operations on your | ||
time series data. | ||
menu: | ||
influxdb3_core: | ||
name: Aggregate data | ||
parent: Query with SQL | ||
identifier: query-sql-aggregate | ||
weight: 203 | ||
influxdb3/core/tags: [query, sql] | ||
related: | ||
- /influxdb3/core/reference/sql/functions/aggregate/ | ||
- /influxdb3/core/reference/sql/functions/selector/ | ||
- /influxdb3/core/reference/sql/group-by/ | ||
list_code_example: | | ||
##### Aggregate fields by groups | ||
```sql | ||
SELECT | ||
mean(field1) AS mean, | ||
selector_first(field2)['value'] as first, | ||
tag1 | ||
FROM home | ||
GROUP BY tag | ||
``` | ||
##### Aggregate by time-based intervals | ||
```sql | ||
SELECT | ||
DATE_BIN(INTERVAL '1 hour', time, '2022-01-01T00:00:00Z'::TIMESTAMP) AS time, | ||
mean(field1), | ||
sum(field2), | ||
tag1 | ||
FROM home | ||
GROUP BY 1, tag1 | ||
``` | ||
source: /shared/influxdb3-query-guides/sql/aggregate-select.md | ||
--- | ||
|
||
<!-- | ||
The content for this page is at content/shared/influxdb3-query-guides/sql/aggregate-select.md | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
title: Perform a basic SQL query | ||
seotitle: Perform a basic SQL query in InfluxDB 3 Core | ||
description: > | ||
A basic SQL query that queries data from {{< product-name >}} most commonly | ||
includes `SELECT`, `FROM`, and `WHERE` clauses. | ||
menu: | ||
influxdb3_core: | ||
name: Basic query | ||
parent: Query with SQL | ||
identifier: query-sql-basic | ||
weight: 202 | ||
influxdb3/core/tags: [query, sql] | ||
list_code_example: | | ||
```sql | ||
SELECT temp, room FROM home WHERE time >= now() - INTERVAL '1 day' | ||
``` | ||
source: /shared/influxdb3-query-guides/sql/basic-query.md | ||
--- | ||
|
||
<!-- | ||
The content for this page is at content/shared/influxdb3-query-guides/sql/basic-query.md | ||
--> |
Oops, something went wrong.