diff --git a/content/influxdb3/core/admin/_index.md b/content/influxdb3/core/admin/_index.md index b0bda9eb6..cfd96a399 100644 --- a/content/influxdb3/core/admin/_index.md +++ b/content/influxdb3/core/admin/_index.md @@ -11,5 +11,6 @@ source: /shared/influxdb3-admin/_index.md --- diff --git a/content/influxdb3/core/admin/query-system-data/_index.md b/content/influxdb3/core/admin/query-system-data/_index.md new file mode 100644 index 000000000..5f7ac3afb --- /dev/null +++ b/content/influxdb3/core/admin/query-system-data/_index.md @@ -0,0 +1,23 @@ +--- +title: Query system data +description: | + Query system tables to see data related + to the server, queries, and tables in an {{% product-name %}} instance. + Use the HTTP SQL query API to retrieve information about your database server + and table schemas. +menu: + influxdb3_core: + name: Query system data + parent: Administer InfluxDB +weight: 3 +influxdb3/core/tags: [query, api, system information, schemas] +related: + - /influxdb3/core/query-data/sql/ + - /influxdb3/core/query-data/execute-queries/ +source: /shared/influxdb3-admin/query-system-data/_index.md +--- + + \ No newline at end of file diff --git a/content/influxdb3/core/get-started/_index.md b/content/influxdb3/core/get-started/_index.md index 4f8a41738..b715d6ddc 100644 --- a/content/influxdb3/core/get-started/_index.md +++ b/content/influxdb3/core/get-started/_index.md @@ -9,9 +9,12 @@ menu: influxdb3_core: name: Get started weight: 3 +related: + - /influxdb3/core/admin/query-system-data/ source: /shared/v3-core-get-started/_index.md --- diff --git a/content/influxdb3/core/http-query-api-system-tables.md b/content/influxdb3/core/http-query-api-system-tables.md deleted file mode 100644 index d61535ad9..000000000 --- a/content/influxdb3/core/http-query-api-system-tables.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Use the HTTP API to access server information and system tables -description: | - Use the HTTP SQL query API to retrieve information about your database server - and table schemas in {{% product-name %}}. -menu: - influxdb3_core: - name: HTTP query API & system tables -weight: 3 -influxdb3/core/tags: [query, api] -source: /shared/v3-core-http-query-api-system-tables/_index.md ---- - - \ No newline at end of file diff --git a/content/influxdb3/enterprise/admin/query-system-data/_index.md b/content/influxdb3/enterprise/admin/query-system-data/_index.md new file mode 100644 index 000000000..5ba273837 --- /dev/null +++ b/content/influxdb3/enterprise/admin/query-system-data/_index.md @@ -0,0 +1,23 @@ +--- +title: Query system data +description: | + Query system tables to see data related + to the server, queries, and tables in an {{% product-name %}} instance. + Use the HTTP SQL query API to retrieve information about your database server + and table schemas. +menu: + influxdb3_enterprise: + name: Query system data + parent: Administer InfluxDB +weight: 3 +influxdb3/enterprise/tags: [query, api, system information, schemas] +related: + - /influxdb3/enterprise/query-data/sql/ + - /influxdb3/enterprise/query-data/execute-queries/ +source: /shared/influxdb3-admin/query-system-data/_index.md +--- + + \ No newline at end of file diff --git a/content/influxdb3/enterprise/get-started/_index.md b/content/influxdb3/enterprise/get-started/_index.md index 0fc055df3..55f130949 100644 --- a/content/influxdb3/enterprise/get-started/_index.md +++ b/content/influxdb3/enterprise/get-started/_index.md @@ -9,9 +9,12 @@ menu: influxdb3_enterprise: name: Get started weight: 3 +related: + - /influxdb3/enterprise/admin/query-system-data/ source: /shared/v3-enterprise-get-started/_index.md --- diff --git a/content/influxdb3/enterprise/http-query-api-system-tables.md b/content/influxdb3/enterprise/http-query-api-system-tables.md deleted file mode 100644 index 50a0873b9..000000000 --- a/content/influxdb3/enterprise/http-query-api-system-tables.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Use the HTTP API to access server information and system tables -description: | - Use the HTTP SQL query API to retrieve information about your database server - and table schemas in {{% product-name %}}. -menu: - influxdb3_enterprise: - name: HTTP query API & system tables -weight: 3 -influxdb3/enterprise/tags: [query, api] -source: /shared/v3-core-http-query-api-system-tables/_index.md ---- - - \ No newline at end of file diff --git a/content/shared/v3-core-http-query-api-system-tables/_index.md b/content/shared/influxdb3-admin/query-system-data/_index.md similarity index 85% rename from content/shared/v3-core-http-query-api-system-tables/_index.md rename to content/shared/influxdb3-admin/query-system-data/_index.md index acb696c03..0a32e68d1 100644 --- a/content/shared/v3-core-http-query-api-system-tables/_index.md +++ b/content/shared/influxdb3-admin/query-system-data/_index.md @@ -1,9 +1,16 @@ -Use the HTTP query API to access and view information about your database server and table schemas in {{% product-name %}}. + +{{% product-name %}} stores data related to the database server, queries, and tables in _system tables_ within your cluster. +You can query the system tables for information about your running server, databases, and and table schemas. -## Query using SQL +## Query system tables -{{% product-name %}} provides the HTTP API `/api/v3/query_sql` endpoint for querying -data, database server information, and system tables. +- [Use the HTTP query API](#use-the-http-query-api) + - [Example: show tables](#example-show-tables) + - [Example: view column information for a table](#example-view-column-information-for-a-table) + +### Use the HTTP query API + +Use the HTTP API `/api/v3/query_sql` endpoint to retrieve and system information about your database server and table schemas in {{% product-name %}}. > [!Note] > {{% product-name %}} uses separate API endpoints for SQL and InfluxQL queries. @@ -11,16 +18,12 @@ data, database server information, and system tables. > > For more information about using InfluxQL, see [Query data with InfluxQL](/influxdb3/version/query-data/influxql/). -To execute a query, send a `GET` request or a `POST` request to the endpoint: +To execute a query, send a `GET` or `POST` request to the endpoint: -- `GET`: Pass parameters in the URL query string. - Use for quickly exploring your data and for queries that you can easily encode in a URL. -- `POST`: Pass parameters in a JSON object. - Use for longer, complex - queries, queries you can't easily URL-encode, and for better readability in - in your code. +- `GET`: Pass parameters in the URL query string (for simple queries) +- `POST`: Pass parameters in a JSON object (for complex queries and readability in your code) -and include the following parameters: +Include the following parameters: - `q`: _({{< req >}})_ The SQL query to execute. - `db`: _({{< req >}})_ The database to execute the query against. @@ -29,7 +32,7 @@ and include the following parameters: JSONL (`jsonl`) is preferred because it streams results back to the client. `pretty` is for human-readable output. Default is `json`. -### Example: show tables +#### Example: show tables The following example sends a `GET` request that executes a `show tables` query to retrieve all user-created @@ -73,12 +76,13 @@ A table has one of the following `table_schema` values: while others, such as the `queries` table, hold ephemeral state in memory. - `information_schema`: views that show schema information for tables in the database. -### Example: view column information for a table +#### Example: view column information for a table The following query sends a `POST` request that executes an SQL query to retrieve information about columns in the sample `system_swap` table schema: -_Note: when sending a query in JSON, escape the single quotes around database field names._ +_Note: when you send a query in JSON, you must escape single quotes +that surround field names._ ```bash curl "http://localhost:8181/api/v3/query_sql" \