Skip to content

Commit 7271869

Browse files
committed
feat(monolith): Query system data for Core and Enterprise
- Revises Paul's draft for using /api/v3/query_sql to query system data. - Copies the existing structure for Ded. and Clustered - Adds an explicit POST example for a longer query.
1 parent d86e7a4 commit 7271869

File tree

8 files changed

+75
-50
lines changed

8 files changed

+75
-50
lines changed

content/influxdb3/core/admin/_index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ source: /shared/influxdb3-admin/_index.md
1111
---
1212

1313
<!--
14-
The content of this file is located at content/shared/influxdb3-admin/_index.md
14+
The content of this file is located at
15+
// SOURCE content/shared/influxdb3-admin/_index.md
1516
-->
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Query system data
3+
description: |
4+
Query system tables to see data related
5+
to the server, queries, and tables in an {{% product-name %}} instance.
6+
Use the HTTP SQL query API to retrieve information about your database server
7+
and table schemas.
8+
menu:
9+
influxdb3_core:
10+
name: Query system data
11+
parent: Administer InfluxDB
12+
weight: 3
13+
influxdb3/core/tags: [query, api, system information, schemas]
14+
related:
15+
- /influxdb3/core/query-data/sql/
16+
- /influxdb3/core/query-data/execute-queries/
17+
source: /shared/influxdb3-admin/query-system-data/_index.md
18+
---
19+
20+
<!--
21+
The content of this page is at
22+
// SOURCE content/shared/influxdb3-admin/query-system-data/_index.md
23+
-->

content/influxdb3/core/get-started/_index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ menu:
99
influxdb3_core:
1010
name: Get started
1111
weight: 3
12+
related:
13+
- /influxdb3/core/admin/query-system-data/
1214
source: /shared/v3-core-get-started/_index.md
1315
---
1416

1517
<!--
16-
The content of this page is at /shared/v3-core-get-started/_index.md
18+
The content of this page is at
19+
// SOURCE content/shared/v3-core-get-started/_index.md
1720
-->

content/influxdb3/core/http-query-api-system-tables.md

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Query system data
3+
description: |
4+
Query system tables to see data related
5+
to the server, queries, and tables in an {{% product-name %}} instance.
6+
Use the HTTP SQL query API to retrieve information about your database server
7+
and table schemas.
8+
menu:
9+
influxdb3_enterprise:
10+
name: Query system data
11+
parent: Administer InfluxDB
12+
weight: 3
13+
influxdb3/enterprise/tags: [query, api, system information, schemas]
14+
related:
15+
- /influxdb3/enterprise/query-data/sql/
16+
- /influxdb3/enterprise/query-data/execute-queries/
17+
source: /shared/influxdb3-admin/query-system-data/_index.md
18+
---
19+
20+
<!--
21+
The content of this page is at
22+
// SOURCE content/shared/influxdb3-admin/query-system-data/_index.md
23+
-->

content/influxdb3/enterprise/get-started/_index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ menu:
99
influxdb3_enterprise:
1010
name: Get started
1111
weight: 3
12+
related:
13+
- /influxdb3/enterprise/admin/query-system-data/
1214
source: /shared/v3-enterprise-get-started/_index.md
1315
---
1416

1517
<!--
16-
The content of this page is at /shared/v3-enterprise-get-started/_index.md
18+
The content of this page is at
19+
// SOURCE content/shared/v3-core-get-started/_index.md
1720
-->

content/influxdb3/enterprise/http-query-api-system-tables.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

content/shared/v3-core-http-query-api-system-tables/_index.md renamed to content/shared/influxdb3-admin/query-system-data/_index.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1-
Use the HTTP query API to access and view information about your database server and table schemas in {{% product-name %}}.
1+
<!--Shortcode-->
2+
{{% product-name %}} stores data related to the database server, queries, and tables in _system tables_ within your cluster.
3+
You can query the system tables for information about your running server, databases, and and table schemas.
24

3-
## Query using SQL
5+
## Query system tables
46

5-
{{% product-name %}} provides the HTTP API `/api/v3/query_sql` endpoint for querying
6-
data, database server information, and system tables.
7+
- [Use the HTTP query API](#use-the-http-query-api)
8+
- [Example: show tables](#example-show-tables)
9+
- [Example: view column information for a table](#example-view-column-information-for-a-table)
10+
11+
### Use the HTTP query API
12+
13+
Use the HTTP API `/api/v3/query_sql` endpoint to retrieve and system information about your database server and table schemas in {{% product-name %}}.
714

815
> [!Note]
916
> {{% product-name %}} uses separate API endpoints for SQL and InfluxQL queries.
1017
> Both endpoints support the same parameters.
1118
>
1219
> For more information about using InfluxQL, see [Query data with InfluxQL](/influxdb3/version/query-data/influxql/).
1320
14-
To execute a query, send a `GET` request or a `POST` request to the endpoint:
21+
To execute a query, send a `GET` or `POST` request to the endpoint:
1522

16-
- `GET`: Pass parameters in the URL query string.
17-
Use for quickly exploring your data and for queries that you can easily encode in a URL.
18-
- `POST`: Pass parameters in a JSON object.
19-
Use for longer, complex
20-
queries, queries you can't easily URL-encode, and for better readability in
21-
in your code.
23+
- `GET`: Pass parameters in the URL query string (for simple queries)
24+
- `POST`: Pass parameters in a JSON object (for complex queries and readability in your code)
2225

23-
and include the following parameters:
26+
Include the following parameters:
2427

2528
- `q`: _({{< req >}})_ The SQL query to execute.
2629
- `db`: _({{< req >}})_ The database to execute the query against.
@@ -29,7 +32,7 @@ and include the following parameters:
2932
JSONL (`jsonl`) is preferred because it streams results back to the client.
3033
`pretty` is for human-readable output. Default is `json`.
3134

32-
### Example: show tables
35+
#### Example: show tables
3336

3437
The following example sends a `GET` request that executes a `show tables` query
3538
to retrieve all user-created
@@ -73,12 +76,13 @@ A table has one of the following `table_schema` values:
7376
while others, such as the `queries` table, hold ephemeral state in memory.
7477
- `information_schema`: views that show schema information for tables in the database.
7578

76-
### Example: view column information for a table
79+
#### Example: view column information for a table
7780

7881
The following query sends a `POST` request that executes an SQL query to
7982
retrieve information about columns in the sample `system_swap` table schema:
8083

81-
_Note: when sending a query in JSON, escape the single quotes around database field names._
84+
_Note: when you send a query in JSON, you must escape single quotes
85+
that surround field names._
8286

8387
```bash
8488
curl "http://localhost:8181/api/v3/query_sql" \

0 commit comments

Comments
 (0)