From 9dfa1cf68bedfd411297bee180708c8c714f9ed2 Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Wed, 28 Jan 2026 14:55:55 -0600 Subject: [PATCH 1/3] feat(influxdb3): Update v3.9 CLI reference - Add --tls-no-verify option to CLI command docs and usage tables - Enterprise `--data-only` and `--remove-tables` flags - Parquet output --- .../shared/influxdb3-cli/create/database.md | 33 ++++--- content/shared/influxdb3-cli/create/table.md | 52 +++++------ .../shared/influxdb3-cli/create/trigger.md | 43 +++++---- .../shared/influxdb3-cli/delete/database.md | 92 ++++++++++++++----- content/shared/influxdb3-cli/delete/table.md | 91 ++++++++++++------ content/shared/influxdb3-cli/delete/token.md | 25 +++-- .../shared/influxdb3-cli/delete/trigger.md | 41 ++++----- .../shared/influxdb3-cli/install/package.md | 6 +- content/shared/influxdb3-cli/show/nodes.md | 18 +++- .../shared/influxdb3-cli/show/retention.md | 32 +++++-- 10 files changed, 280 insertions(+), 153 deletions(-) diff --git a/content/shared/influxdb3-cli/create/database.md b/content/shared/influxdb3-cli/create/database.md index 73147f5cc9..7a6f8dec07 100644 --- a/content/shared/influxdb3-cli/create/database.md +++ b/content/shared/influxdb3-cli/create/database.md @@ -7,6 +7,7 @@ Provide a database name and, optionally, specify connection settings and authent ```bash +# Syntax influxdb3 create database [OPTIONS] ``` @@ -29,6 +30,7 @@ You can also set the database name using the `INFLUXDB3_DATABASE_NAME` environme | | `--retention-period` | Database [retention period](/influxdb3/version/reference/glossary/#retention-period) ([duration](/influxdb3/version/reference/glossary/#duration) value, for example: `30d`, `24h`, `1h`) | | | `--token` | Authentication token | | | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | +| | `--tls-no-verify` | Disable TLS certificate verification (useful for development or self-signed certificates) | | `-h` | `--help` | Print help information | | | `--help-all` | Print detailed help information | @@ -36,30 +38,29 @@ You can also set the database name using the `INFLUXDB3_DATABASE_NAME` environme You can use the following environment variables instead of providing CLI options directly: -| Environment Variable | Option | -| :------------------------ | :----------- | -| `INFLUXDB3_HOST_URL` | `--host` | -| `INFLUXDB3_AUTH_TOKEN` | `--token` | +| Environment Variable | Option | +| :------------------------ | :---------------- | +| `INFLUXDB3_HOST_URL` | `--host` | +| `INFLUXDB3_AUTH_TOKEN` | `--token` | +| `INFLUXDB3_TLS_NO_VERIFY` | `--tls-no-verify` | ## Examples The following examples show how to create a database. -In your commands replace the following: +In the examples below, replace the following: - {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: Database name -- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: +- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: Authentication token -{{% code-placeholders "DATABASE_NAME|AUTH_TOKEN" %}} - ### Create a database (default) Creates a database using settings from environment variables and defaults. -```bash +```bash { placeholders="DATABASE_NAME" } influxdb3 create database DATABASE_NAME ``` @@ -70,7 +71,7 @@ Flags override their associated environment variables. -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME" } influxdb3 create database --token AUTH_TOKEN DATABASE_NAME ``` @@ -81,7 +82,7 @@ Data older than 30 days will not be queryable. -```bash +```bash { placeholders="DATABASE_NAME" } influxdb3 create database --retention-period 30d DATABASE_NAME ``` @@ -91,7 +92,7 @@ Creates a database with no retention period (data never expires). -```bash +```bash { placeholders="DATABASE_NAME" } influxdb3 create database --retention-period none DATABASE_NAME ``` @@ -101,7 +102,7 @@ Creates a database with a 90-day retention period using an authentication token. -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME" } influxdb3 create database \ --retention-period 90d \ --token AUTH_TOKEN \ @@ -114,7 +115,7 @@ Creates a database with a 1-year retention period. -```bash +```bash { placeholders="DATABASE_NAME" } influxdb3 create database --retention-period 1y DATABASE_NAME ``` @@ -124,12 +125,10 @@ Creates a database with a retention period of 30 days and 12 hours. -```bash +```bash { placeholders="DATABASE_NAME" } influxdb3 create database --retention-period 30d12h DATABASE_NAME ``` -{{% /code-placeholders %}} - ## Retention period duration formats Retention periods are specified as [duration](/influxdb3/version/reference/glossary/#duration) diff --git a/content/shared/influxdb3-cli/create/table.md b/content/shared/influxdb3-cli/create/table.md index 5d72600b5b..a6675d2d70 100644 --- a/content/shared/influxdb3-cli/create/table.md +++ b/content/shared/influxdb3-cli/create/table.md @@ -11,6 +11,7 @@ The `influxdb3 create table` command creates a new table in a specified database ```bash +# Syntax influxdb3 create table [OPTIONS] \ --tags [...] \ --database \ @@ -28,16 +29,17 @@ influxdb3 create table [OPTIONS] \ --> {{% hide-in "enterprise" %}} -| Option | | Description | -| :----- | :----------- | :--------------------------------------------------------------------------------------- | -| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) | -| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on | -| | `--token` | _({{< req >}})_ Authentication token | -| | `--tags` | _({{< req >}})_ Comma-separated list of tag columns to include in the table | -| | `--fields` | Comma-separated list of field columns and their types to include in the table | -| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | -| `-h` | `--help` | Print help information | -| | `--help-all` | Print detailed help information | +| Option | | Description | +| :----- | :---------------- | :--------------------------------------------------------------------------------------- | +| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) | +| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on | +| | `--token` | _({{< req >}})_ Authentication token | +| | `--tags` | _({{< req >}})_ Comma-separated list of tag columns to include in the table | +| | `--fields` | Comma-separated list of field columns and their types to include in the table | +| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | +| | `--tls-no-verify` | Disable TLS certificate verification (useful for development or self-signed certificates)| +| `-h` | `--help` | Print help information | +| | `--help-all` | Print detailed help information | {{% /hide-in %}} @@ -51,6 +53,7 @@ influxdb3 create table [OPTIONS] \ | | `--tags` | _({{< req >}})_ Comma-separated list of tag columns to include in the table | | | `--fields` | Comma-separated list of field columns and their types to include in the table | | | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | +| | `--tls-no-verify` | Disable TLS certificate verification (useful for development or self-signed certificates) | | `-h` | `--help` | Print help information | | | `--help-all` | Print detailed help information | {{% /show-in %}} @@ -66,30 +69,29 @@ influxdb3 create table [OPTIONS] \ You can use the following environment variables to set options instead of passing them via CLI flags: -| Environment Variable | Option | -| :------------------------ | :----------- | -| `INFLUXDB3_HOST_URL` | `--host` | -| `INFLUXDB3_DATABASE_NAME` | `--database` | -| `INFLUXDB3_AUTH_TOKEN` | `--token` | +| Environment Variable | Option | +| :------------------------ | :---------------- | +| `INFLUXDB3_HOST_URL` | `--host` | +| `INFLUXDB3_DATABASE_NAME` | `--database` | +| `INFLUXDB3_AUTH_TOKEN` | `--token` | +| `INFLUXDB3_TLS_NO_VERIFY` | `--tls-no-verify` | ## Examples -In the following examples, replace each placeholder with your actual values: +In the examples below, replace the following: - {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: The database name - {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: - Authentication token -- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}: + The authentication token +- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}: A name for the new table -{{% code-placeholders "DATABASE_NAME|TABLE_NAME|AUTH_TOKEN" %}} - ### Create an empty table -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|TABLE_NAME" } influxdb3 create table \ --tags tag1,tag2,tag3 \ --database DATABASE_NAME \ @@ -101,7 +103,7 @@ influxdb3 create table \ -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|TABLE_NAME" } influxdb3 create table \ --tags room,sensor_id \ --fields temp:float64,hum:float64,co:int64 \ @@ -115,7 +117,7 @@ influxdb3 create table \ -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|TABLE_NAME" } influxdb3 create table \ --tags room,sensor_id \ --fields temp:float64,hum:float64 \ @@ -132,7 +134,7 @@ Use the `SHOW TABLES` query to verify that the table was created successfully: -```bash +```bash { placeholders="AUTH_TOKEN" } influxdb3 query \ --database my_test_db \ --token AUTH_TOKEN \ @@ -152,5 +154,3 @@ Example output: > [!Note] > `SHOW TABLES` is an SQL query. It isn't supported in InfluxQL. - -{{% /code-placeholders %}} diff --git a/content/shared/influxdb3-cli/create/trigger.md b/content/shared/influxdb3-cli/create/trigger.md index 4bfbd0d3ce..4ab61613d1 100644 --- a/content/shared/influxdb3-cli/create/trigger.md +++ b/content/shared/influxdb3-cli/create/trigger.md @@ -7,6 +7,7 @@ processing engine. ```bash +# Syntax influxdb3 create trigger [OPTIONS] \ --database \ --token \ @@ -40,6 +41,7 @@ influxdb3 create trigger [OPTIONS] \ | | `--run-asynchronous` | Run the trigger asynchronously, allowing multiple triggers to run simultaneously (default is synchronous) | {{% show-in "enterprise" %}}| | `--node-spec` | Which node(s) the trigger should be configured on. Two value formats are supported: `all` (default) - applies to all nodes, or `nodes:[,..]` - applies only to specified comma-separated list of nodes |{{% /show-in %}} | | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | +| | `--tls-no-verify` | Disable TLS certificate verification (useful for development or self-signed certificates) | | `-h` | `--help` | Print help information | | | `--help-all` | Print detailed help information | @@ -51,11 +53,12 @@ For example, to use the [System Metrics](https://github.com/influxdata/influxdb3 You can use the following environment variables to set command options: -| Environment Variable | Option | -| :------------------------ | :----------- | -| `INFLUXDB3_HOST_URL` | `--host` | -| `INFLUXDB3_DATABASE_NAME` | `--database` | -| `INFLUXDB3_AUTH_TOKEN` | `--token` | +| Environment Variable | Option | +| :------------------------ | :---------------- | +| `INFLUXDB3_HOST_URL` | `--host` | +| `INFLUXDB3_DATABASE_NAME` | `--database` | +| `INFLUXDB3_AUTH_TOKEN` | `--token` | +| `INFLUXDB3_TLS_NO_VERIFY` | `--tls-no-verify` | ## Examples @@ -81,9 +84,7 @@ Replace the following placeholders with your values: - {{% code-placeholder-key %}}`TRIGGER_NAME`{{% /code-placeholder-key %}}: Name of the trigger to create - {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}: -Name of the table to trigger on - -{{% code-placeholders "(DATABASE|TRIGGER)_NAME|AUTH_TOKEN|TABLE_NAME" %}} + Name of the table to trigger on ### Create a trigger for a specific table @@ -91,7 +92,7 @@ Create a trigger that processes data from a specific table. -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|PLUGIN_FILENAME|TABLE_NAME|TRIGGER_NAME" } influxdb3 create trigger \ --database DATABASE_NAME \ --token AUTH_TOKEN \ @@ -108,7 +109,7 @@ Create a trigger that applies to all tables in the specified database. -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|PLUGIN_FILENAME|TRIGGER_NAME" } influxdb3 create trigger \ --database DATABASE_NAME \ --token AUTH_TOKEN \ @@ -125,7 +126,7 @@ This is useful when you want a trigger to apply to any table in the database, re Create a trigger that runs at a specific interval using a duration. Supported duration units: `s` (seconds), `m` (minutes), `h` (hours), `d` (days), `w` (weeks), `M` (months), `y` (years). Maximum interval is 1 year. -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|PLUGIN_FILENAME|TRIGGER_NAME" } influxdb3 create trigger \ --database DATABASE_NAME \ --token AUTH_TOKEN \ @@ -150,7 +151,7 @@ Fields: Example: Run at 6:00 AM every weekday (Monday-Friday): -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|PLUGIN_FILENAME|TRIGGER_NAME" } influxdb3 create trigger \ --database DATABASE_NAME \ --token AUTH_TOKEN \ @@ -165,7 +166,7 @@ influxdb3 create trigger \ Create a trigger that provides an API endpoint and processes HTTP requests. -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|PLUGIN_FILENAME|REQUEST_PATH|TRIGGER_NAME" } influxdb3 create trigger \ --database DATABASE_NAME \ --token AUTH_TOKEN \ @@ -182,7 +183,7 @@ Create a trigger using a plugin organized in multiple files. The plugin director -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|TRIGGER_NAME" } influxdb3 create trigger \ --database DATABASE_NAME \ --token AUTH_TOKEN \ @@ -208,7 +209,7 @@ Upload plugin files from your local machine and create a trigger in a single com -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|TABLE_NAME|TRIGGER_NAME" } # Upload single-file plugin influxdb3 create trigger \ --database DATABASE_NAME \ @@ -237,7 +238,7 @@ For more information, see [Upload plugins from local machine](/influxdb3/version ### Create a trigger with additional arguments -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|PLUGIN_FILENAME|TABLE_NAME|TRIGGER_NAME" } influxdb3 create trigger \ --database DATABASE_NAME \ --token AUTH_TOKEN \ @@ -253,7 +254,7 @@ Create a trigger in a disabled state. -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|PLUGIN_FILENAME|TABLE_NAME|TRIGGER_NAME" } influxdb3 create trigger \ --disabled \ --database DATABASE_NAME \ @@ -269,7 +270,7 @@ Creating a trigger in a disabled state prevents it from running immediately. You Log the error to the service output and the `system.processing_engine_logs` table: -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|PLUGIN_FILENAME|TABLE_NAME|TRIGGER_NAME" } influxdb3 create trigger \ --database DATABASE_NAME \ --token AUTH_TOKEN \ @@ -281,7 +282,7 @@ influxdb3 create trigger \ Rerun the trigger if it fails: -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|PLUGIN_FILENAME|TABLE_NAME|TRIGGER_NAME" } influxdb3 create trigger \ --database DATABASE_NAME \ --token AUTH_TOKEN \ @@ -293,7 +294,7 @@ influxdb3 create trigger \ Disable the trigger if it fails: -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|PLUGIN_FILENAME|TABLE_NAME|TRIGGER_NAME" } influxdb3 create trigger \ --database DATABASE_NAME \ --token AUTH_TOKEN \ @@ -302,5 +303,3 @@ influxdb3 create trigger \ --error-behavior disable \ TRIGGER_NAME ``` - -{{% /code-placeholders %}} diff --git a/content/shared/influxdb3-cli/delete/database.md b/content/shared/influxdb3-cli/delete/database.md index e9238402a7..52e018cf0d 100644 --- a/content/shared/influxdb3-cli/delete/database.md +++ b/content/shared/influxdb3-cli/delete/database.md @@ -6,6 +6,7 @@ The `influxdb3 delete database` command deletes a database. ```bash +# Syntax influxdb3 delete database [OPTIONS] ``` @@ -21,28 +22,48 @@ influxdb3 delete database [OPTIONS] --database-name: internal variable, use positional --> -| Option | | Description | -| :----- | :------------ | :--------------------------------------------------------------------------------------- | -| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) | -| | `--hard-delete` | When to hard delete data (never/now/default/timestamp). Default behavior is a soft delete that allows recovery | -| | `--token` | Authentication token | -| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | -| `-h` | `--help` | Print help information | -| | `--help-all` | Print detailed help information | +{{% hide-in "enterprise" %}} +| Option | | Description | +| :----- | :---------------- | :--------------------------------------------------------------------------------------- | +| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) | +| | `--hard-delete` | When to hard delete data (never/now/default/timestamp). Default behavior is a soft delete that allows recovery | +| | `--token` | Authentication token | +| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | +| | `--tls-no-verify` | Disable TLS certificate verification (useful for development or self-signed certificates)| +| `-h` | `--help` | Print help information | +| | `--help-all` | Print detailed help information | +{{% /hide-in %}} + +{{% show-in "enterprise" %}} +| Option | | Description | +| :----- | :---------------- | :--------------------------------------------------------------------------------------- | +| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) | +| | `--data-only` | Delete only data while preserving schemas and all associated resources (tokens, triggers, caches, etc.). Default behavior deletes everything | +| | `--remove-tables` | Used with `--data-only` to remove table resources (caches) while preserving database-level resources (tokens, triggers, processing engine configurations) | +| | `--hard-delete` | When to hard delete data (never/now/default/timestamp). Default behavior is a soft delete that allows recovery | +| | `--token` | Authentication token | +| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | +| | `--tls-no-verify` | Disable TLS certificate verification (useful for development or self-signed certificates)| +| `-h` | `--help` | Print help information | +| | `--help-all` | Print detailed help information | +{{% /show-in %}} ### Option environment variables You can use the following environment variables to set command options: -| Environment Variable | Option | -| :------------------------ | :----------- | -| `INFLUXDB3_HOST_URL` | `--host` | -| `INFLUXDB3_AUTH_TOKEN` | `--token` | +| Environment Variable | Option | +| :------------------------ | :---------------- | +| `INFLUXDB3_HOST_URL` | `--host` | +| `INFLUXDB3_AUTH_TOKEN` | `--token` | +| `INFLUXDB3_TLS_NO_VERIFY` | `--tls-no-verify` | ## Examples - [Delete a database](#delete-a-database) - [Delete a database while specifying the token inline](#delete-a-database-while-specifying-the-token-inline) +{{% show-in "enterprise" %}}- [Delete database data only (preserve schema and resources)](#delete-database-data-only-preserve-schema-and-resources) +- [Delete database data and tables (preserve database resources)](#delete-database-data-and-tables-preserve-database-resources){{% /show-in %}} - [Hard delete a database immediately](#hard-delete-a-database-immediately) - [Hard delete a database at a specific time](#hard-delete-a-database-at-a-specific-time) @@ -50,16 +71,14 @@ In the examples below, replace the following: - {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: Database name -- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: +- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: Authentication token -{{% code-placeholders "DATABASE_NAME|AUTH_TOKEN" %}} - ### Delete a database -```bash +```bash { placeholders="DATABASE_NAME" } influxdb3 delete database DATABASE_NAME ``` @@ -67,17 +86,50 @@ influxdb3 delete database DATABASE_NAME -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME" } influxdb3 delete database --token AUTH_TOKEN DATABASE_NAME ``` +{{% show-in "enterprise" %}} +### Delete database data only (preserve schema and resources) + +Delete all data from a database while preserving: +- Database schema (tables and columns) +- Authentication tokens +- Processing engine configurations and triggers +- Last value caches (LVC) and distinct value caches (DVC) + +This is useful when you want to clear old data and re-write new data to the same schema without recreating resources. + + + +```bash { placeholders="DATABASE_NAME" } +influxdb3 delete database --data-only DATABASE_NAME +``` + +### Delete database data and tables (preserve database resources) + +Delete all data and table resources (caches) while preserving database-level resources: +- Authentication tokens +- Processing engine triggers +- Processing engine configurations + +This is useful when you want to start fresh with a new schema but keep existing authentication and trigger configurations. + + + +```bash { placeholders="DATABASE_NAME" } +influxdb3 delete database --data-only --remove-tables DATABASE_NAME +``` +{{% /show-in %}} + ### Hard delete a database immediately Permanently delete a database and all its data immediately without the ability to recover. -```bash +```bash { placeholders="DATABASE_NAME" } influxdb3 delete database --hard-delete now DATABASE_NAME ``` @@ -87,8 +139,6 @@ Schedule a database for permanent deletion at a specific timestamp. -```bash +```bash { placeholders="DATABASE_NAME" } influxdb3 delete database --hard-delete "2024-01-01T00:00:00Z" DATABASE_NAME ``` - -{{% /code-placeholders %}} diff --git a/content/shared/influxdb3-cli/delete/table.md b/content/shared/influxdb3-cli/delete/table.md index 13d6de6972..2435be5e82 100644 --- a/content/shared/influxdb3-cli/delete/table.md +++ b/content/shared/influxdb3-cli/delete/table.md @@ -6,6 +6,7 @@ The `influxdb3 delete table` command deletes a table from a database. ```bash +# Syntax influxdb3 delete table [OPTIONS] --database ``` @@ -19,40 +20,85 @@ influxdb3 delete table [OPTIONS] --database --table-name: internal variable, use positional --> -| Option | | Description | -| :----- | :------------ | :--------------------------------------------------------------------------------------- | -| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) | -| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on | -| | `--hard-delete` | When to hard delete data (never/now/default/timestamp). Default behavior is a soft delete that allows recovery | -| | `--token` | _({{< req >}})_ Authentication token | -| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | -| `-h` | `--help` | Print help information | -| | `--help-all` | Print detailed help information | +{{% hide-in "enterprise" %}} +| Option | | Description | +| :----- | :---------------- | :--------------------------------------------------------------------------------------- | +| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) | +| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on | +| | `--hard-delete` | When to hard delete data (never/now/default/timestamp). Default behavior is a soft delete that allows recovery | +| | `--token` | _({{< req >}})_ Authentication token | +| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | +| | `--tls-no-verify` | Disable TLS certificate verification (useful for development or self-signed certificates)| +| `-h` | `--help` | Print help information | +| | `--help-all` | Print detailed help information | +{{% /hide-in %}} + +{{% show-in "enterprise" %}} +| Option | | Description | +| :----- | :---------------- | :--------------------------------------------------------------------------------------- | +| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) | +| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on | +| | `--data-only` | Delete only data while preserving the table schema and all associated resources (caches, etc.). Default behavior deletes everything | +| | `--hard-delete` | When to hard delete data (never/now/default/timestamp). Default behavior is a soft delete that allows recovery | +| | `--token` | _({{< req >}})_ Authentication token | +| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | +| | `--tls-no-verify` | Disable TLS certificate verification (useful for development or self-signed certificates)| +| `-h` | `--help` | Print help information | +| | `--help-all` | Print detailed help information | +{{% /show-in %}} ### Option environment variables You can use the following environment variables to set command options: -| Environment Variable | Option | -| :------------------------ | :----------- | -| `INFLUXDB3_HOST_URL` | `--host` | -| `INFLUXDB3_DATABASE_NAME` | `--database` | -| `INFLUXDB3_AUTH_TOKEN` | `--token` | +| Environment Variable | Option | +| :------------------------ | :---------------- | +| `INFLUXDB3_HOST_URL` | `--host` | +| `INFLUXDB3_DATABASE_NAME` | `--database` | +| `INFLUXDB3_AUTH_TOKEN` | `--token` | +| `INFLUXDB3_TLS_NO_VERIFY` | `--tls-no-verify` | ## Examples +In the examples below, replace the following: + +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: + Database name +- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: + Authentication token +- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}: + Name of the table to delete + ### Delete a table -{{% code-placeholders "(DATABASE|TABLE)_NAME|AUTH_TOKEN" %}} + + +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|TABLE_NAME" } +influxdb3 delete table \ + --database DATABASE_NAME \ + --token AUTH_TOKEN \ + TABLE_NAME +``` + +{{% show-in "enterprise" %}} +### Delete table data only (preserve schema and resources) + +Delete all data from a table while preserving: +- Table schema (column definitions) +- Last value caches (LVC) and distinct value caches (DVC) associated with the table + +This is useful when you want to clear old data and re-write new data to the same schema without recreating the table structure. -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|TABLE_NAME" } influxdb3 delete table \ --database DATABASE_NAME \ --token AUTH_TOKEN \ + --data-only \ TABLE_NAME ``` +{{% /show-in %}} ### Hard delete a table immediately @@ -60,21 +106,10 @@ Permanently delete a table and all its data immediately without the ability to r -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|TABLE_NAME" } influxdb3 delete table \ --database DATABASE_NAME \ --token AUTH_TOKEN \ --hard-delete now \ TABLE_NAME ``` - -{{% /code-placeholders %}} - -Replace the following: - -- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: - Database name -- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: - Authentication token -- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}: - Name of the table to delete diff --git a/content/shared/influxdb3-cli/delete/token.md b/content/shared/influxdb3-cli/delete/token.md index 73cfd688a3..fb7c3dd99c 100644 --- a/content/shared/influxdb3-cli/delete/token.md +++ b/content/shared/influxdb3-cli/delete/token.md @@ -4,24 +4,33 @@ The `influxdb3 delete token` command deletes an authorization token from the {{% ## Usage ```bash +# Syntax influxdb3 delete token [OPTIONS] ``` ## Options -| Option | Description | Default | Environment | -|----------------|-----------------------------------------------------------------------------------|---------|------------------------| -| `--token` | _({{< req >}})_ The token for authentication with the {{% product-name %}} server | | `INFLUXDB3_AUTH_TOKEN` | -| `--token-name` | _({{< req >}})_ The name of the token to be deleted | | | -| `--tls-ca` | An optional arg to use a custom ca for useful for testing with self signed certs | | `INFLUXDB3_TLS_CA` | -| `-h` | `--help` | Print help information | -| | `--help-all` | Print detailed help information | +| Option | Description | Default | Environment | +|--------------------|-----------------------------------------------------------------------------------|---------|----------------------------| +| `--token` | _({{< req >}})_ The token for authentication with the {{% product-name %}} server | | `INFLUXDB3_AUTH_TOKEN` | +| `--token-name` | _({{< req >}})_ The name of the token to be deleted | | | +| `--tls-ca` | An optional arg to use a custom ca for useful for testing with self signed certs | | `INFLUXDB3_TLS_CA` | +| `--tls-no-verify` | Disable TLS certificate verification (useful for development or self-signed certificates) | | `INFLUXDB3_TLS_NO_VERIFY` | +| `-h`, `--help` | Print help information | | | +| `--help-all` | Print detailed help information | | | ## Examples +In the examples below, replace the following: + +- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: + Authentication token with permission to delete tokens +- {{% code-placeholder-key %}}`TOKEN_TO_DELETE`{{% /code-placeholder-key %}}: + Name of the token to delete + ### Delete a token by name -```bash +```bash { placeholders="AUTH_TOKEN|TOKEN_TO_DELETE" } influxdb3 delete token --token-name TOKEN_TO_DELETE --token AUTH_TOKEN ``` diff --git a/content/shared/influxdb3-cli/delete/trigger.md b/content/shared/influxdb3-cli/delete/trigger.md index db8b94255d..5c207f4d94 100644 --- a/content/shared/influxdb3-cli/delete/trigger.md +++ b/content/shared/influxdb3-cli/delete/trigger.md @@ -6,6 +6,7 @@ The `influxdb3 delete trigger` command deletes a processing engine trigger. ```bash +# Syntax influxdb3 delete trigger [OPTIONS] --database ``` @@ -19,25 +20,27 @@ influxdb3 delete trigger [OPTIONS] --database --trigger-name: internal variable, use positional --> -| Option | | Description | -| :----- | :----------- | :--------------------------------------------------------------------------------------- | -| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) | -| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on | -| | `--token` | _({{< req >}})_ Authentication token | -| | `--force` | Force delete even if the trigger is active | -| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | -| `-h` | `--help` | Print help information | -| | `--help-all` | Print detailed help information | +| Option | | Description | +| :----- | :---------------- | :--------------------------------------------------------------------------------------- | +| `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) | +| `-d` | `--database` | _({{< req >}})_ Name of the database to operate on | +| | `--token` | _({{< req >}})_ Authentication token | +| | `--force` | Force delete even if the trigger is active | +| | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | +| | `--tls-no-verify` | Disable TLS certificate verification (useful for development or self-signed certificates)| +| `-h` | `--help` | Print help information | +| | `--help-all` | Print detailed help information | ### Option environment variables You can use the following environment variables to set command options: -| Environment Variable | Option | -| :------------------------ | :----------- | -| `INFLUXDB3_HOST_URL` | `--host` | -| `INFLUXDB3_DATABASE_NAME` | `--database` | -| `INFLUXDB3_AUTH_TOKEN` | `--token` | +| Environment Variable | Option | +| :------------------------ | :---------------- | +| `INFLUXDB3_HOST_URL` | `--host` | +| `INFLUXDB3_DATABASE_NAME` | `--database` | +| `INFLUXDB3_AUTH_TOKEN` | `--token` | +| `INFLUXDB3_TLS_NO_VERIFY` | `--tls-no-verify` | ## Examples @@ -50,16 +53,14 @@ In the examples below, replace the following: Database name - {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: Authentication token -- {{% code-placeholder-key %}}`TRIGGER_NAME`{{% /code-placeholder-key %}}: +- {{% code-placeholder-key %}}`TRIGGER_NAME`{{% /code-placeholder-key %}}: Name of the trigger to delete -{{% code-placeholders "(DATABASE|TRIGGER)_NAME|AUTH_TOKEN" %}} - ### Delete a trigger -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|TRIGGER_NAME" } influxdb3 delete trigger \ --database DATABASE_NAME \ --token AUTH_TOKEN \ @@ -70,12 +71,10 @@ influxdb3 delete trigger \ -```bash +```bash { placeholders="AUTH_TOKEN|DATABASE_NAME|TRIGGER_NAME" } influxdb3 delete trigger \ --force \ --database DATABASE_NAME \ --token AUTH_TOKEN \ TRIGGER_NAME ``` - -{{% /code-placeholders %}} diff --git a/content/shared/influxdb3-cli/install/package.md b/content/shared/influxdb3-cli/install/package.md index 3c830ce627..240cc6b7cb 100644 --- a/content/shared/influxdb3-cli/install/package.md +++ b/content/shared/influxdb3-cli/install/package.md @@ -4,6 +4,7 @@ Use this command to add external dependencies that your plugins require, such as ## Usage ```bash +# Syntax influxdb3 install package [OPTIONS] [PACKAGES]... ``` @@ -27,6 +28,7 @@ influxdb3 install package [OPTIONS] [PACKAGES]... | `--plugin-repo ` | Plugin repository URL | | `INFLUXDB3_PLUGIN_REPO` | | `-r`, `--requirements ` | Path to a `requirements.txt` file | | | | `--tls-ca ` | Custom CA certificate for TLS (useful for self-signed certificates) | | `INFLUXDB3_TLS_CA` | +| `--tls-no-verify` | Disable TLS certificate verification (useful for development or self-signed certificates) | | `INFLUXDB3_TLS_NO_VERIFY` | | `-h`, `--help` | Print help information | | | | `--help-all` | Print detailed help information | | | @@ -59,9 +61,7 @@ influxdb3 install package \ pint pandas ``` -Replace the following: - -- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: your {{% token-link "admin" %}} for your {{< product-name >}} instance +Replace {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}} with your {{% token-link "admin" %}} for your {{< product-name >}} instance. ### Install packages with a specific package manager diff --git a/content/shared/influxdb3-cli/show/nodes.md b/content/shared/influxdb3-cli/show/nodes.md index 4e641d2f83..990eb2e1a5 100644 --- a/content/shared/influxdb3-cli/show/nodes.md +++ b/content/shared/influxdb3-cli/show/nodes.md @@ -5,6 +5,7 @@ The `influxdb3 show nodes` command displays information about nodes in your {{< ```bash +# Syntax influxdb3 show nodes [OPTIONS] ``` @@ -13,7 +14,8 @@ influxdb3 show nodes [OPTIONS] | Option | | Description | | :----- | :--------- | :--------------------------------------------------------------------------------------- | | `-H` | `--host` | Host URL of the running {{< product-name >}} server (default is `http://127.0.0.1:8181`) | -| | `--format` | Output format: `pretty` (default), `json`, or `csv` | +| | `--format` | Output format (`pretty` _(default)_, `json`, `jsonl`, `csv`, or `parquet`) | +| | `--output` | Path where to save output when using the `parquet` format | | | `--token` | Authentication token | | | `--tls-ca` | Path to a custom TLS certificate authority (for testing or self-signed certificates) | | `-h` | `--help` | Print help information | @@ -44,6 +46,7 @@ The command displays the following information for each node: - [List all nodes in pretty format](#list-all-nodes-in-pretty-format) - [List nodes in JSON format](#list-nodes-in-json-format) +- [Export nodes data to Parquet format](#export-nodes-data-to-parquet-format) - [List nodes on a remote server](#list-nodes-on-a-remote-server) ### List all nodes in pretty format @@ -106,6 +109,19 @@ The output is similar to the following: ] ``` +### Export nodes data to Parquet format + +[Parquet](https://parquet.apache.org/) is a binary format. +Use the `--output` option to specify the file where you want to save the Parquet data. + + + +```bash +influxdb3 show nodes \ + --format parquet \ + --output nodes-data.parquet +``` + ### List nodes on a remote server diff --git a/content/shared/influxdb3-cli/show/retention.md b/content/shared/influxdb3-cli/show/retention.md index eed5b5002f..7b55628d7c 100644 --- a/content/shared/influxdb3-cli/show/retention.md +++ b/content/shared/influxdb3-cli/show/retention.md @@ -5,6 +5,7 @@ The `influxdb3 show retention` command displays effective retention periods for ```bash +# Syntax influxdb3 show retention [OPTIONS] ``` @@ -35,25 +36,28 @@ You can use the following environment variables to set command options: - [Show retention for all tables](#show-retention-for-all-tables) - [Show retention for a specific database](#show-retention-for-a-specific-database) - [Show retention in JSON format](#show-retention-in-json-format) +- [Export retention data to Parquet format](#export-retention-data-to-parquet-format) + +In the examples below, replace {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}} with your authentication token. ### Show retention for all tables -```bash +```bash { placeholders="AUTH_TOKEN" } influxdb3 show retention \ --host http://localhost:8181 \ - --token YOUR_AUTH_TOKEN + --token AUTH_TOKEN ``` ### Show retention for a specific database -```bash +```bash { placeholders="AUTH_TOKEN" } influxdb3 show retention \ --host http://localhost:8181 \ - --token YOUR_AUTH_TOKEN \ + --token AUTH_TOKEN \ --database mydb ``` @@ -61,13 +65,29 @@ influxdb3 show retention \ -```bash +```bash { placeholders="AUTH_TOKEN" } influxdb3 show retention \ --host http://localhost:8181 \ - --token YOUR_AUTH_TOKEN \ + --token AUTH_TOKEN \ --format json ``` +### Export retention data to Parquet format + +[Parquet](https://parquet.apache.org/) is a binary format. +When using the `parquet` format, data is written to standard output by default. +Use output redirection or the `--output` option to save the data to a file. + + + +```bash { placeholders="AUTH_TOKEN" } +influxdb3 show retention \ + --host http://localhost:8181 \ + --token AUTH_TOKEN \ + --format parquet \ + --output retention-data.parquet +``` + ## Output The command displays the following information for each table: From 0ef69d7e67db35925deedeb07b8fd746cc880835 Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Wed, 28 Jan 2026 15:02:55 -0600 Subject: [PATCH 2/3] feat(influxdb3): v3.9.0 API reference - Enterprise: Add data_only and remove_tables params to database and table delete endpoints --- api-docs/influxdb3/enterprise/v3/ref.yml | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/api-docs/influxdb3/enterprise/v3/ref.yml b/api-docs/influxdb3/enterprise/v3/ref.yml index 7b417824c3..00911b80af 100644 --- a/api-docs/influxdb3/enterprise/v3/ref.yml +++ b/api-docs/influxdb3/enterprise/v3/ref.yml @@ -1145,8 +1145,29 @@ paths: Soft deletes a database. The database is scheduled for deletion and unavailable for querying. Use the `hard_delete_at` parameter to schedule a hard deletion. + Use the `data_only` parameter to delete data while preserving the database schema and resources. parameters: - $ref: '#/components/parameters/db' + - name: data_only + in: query + required: false + schema: + type: boolean + default: false + description: | + Delete only data while preserving the database schema and all associated resources + (tokens, triggers, last value caches, distinct value caches, processing engine configurations). + When `false` (default), the entire database is deleted. + - name: remove_tables + in: query + required: false + schema: + type: boolean + default: false + description: | + Used with `data_only=true` to remove table resources (caches) while preserving + database-level resources (tokens, triggers, processing engine configurations). + Has no effect when `data_only=false`. - name: hard_delete_at in: query required: false @@ -1217,6 +1238,7 @@ paths: Soft deletes a table. The table is scheduled for deletion and unavailable for querying. Use the `hard_delete_at` parameter to schedule a hard deletion. + Use the `data_only` parameter to delete data while preserving the table schema and resources. #### Deleting a table cannot be undone @@ -1229,6 +1251,16 @@ paths: required: true schema: type: string + - name: data_only + in: query + required: false + schema: + type: boolean + default: false + description: | + Delete only data while preserving the table schema and all associated resources + (last value caches, distinct value caches). + When `false` (default), the entire table is deleted. - name: hard_delete_at in: query required: false From 576214fc43dfc000bafc28ad7e79dcb191129912 Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Wed, 28 Jan 2026 15:26:58 -0600 Subject: [PATCH 3/3] feat(influxdb3): v3.9.0 Document data-only deletion for databases and tables - Add instructions for deleting only data (preserving schema and resources) for both databases and tables in InfluxDB 3 Enterprise - Update CLI and HTTP API usage examples - Clarify Parquet output instructions for database listing - Bump latest_patch to 3.9.0 for core and enterprise in products.yml --- .../influxdb3-admin/databases/delete.md | 67 +++++++++++++++++++ .../shared/influxdb3-admin/databases/list.md | 16 +++-- .../shared/influxdb3-admin/tables/delete.md | 51 +++++++++++++- data/products.yml | 4 +- 4 files changed, 129 insertions(+), 9 deletions(-) diff --git a/content/shared/influxdb3-admin/databases/delete.md b/content/shared/influxdb3-admin/databases/delete.md index bac01ccf1a..ebb655a273 100644 --- a/content/shared/influxdb3-admin/databases/delete.md +++ b/content/shared/influxdb3-admin/databases/delete.md @@ -11,6 +11,7 @@ the [HTTP API](/influxdb3/version/api/v3/), or [InfluxDB 3 Explorer](/influxdb3/ - [Delete a database using the influxdb3 CLI](#delete-a-database-using-the-influxdb3-cli) - [Delete a database using the HTTP API](#delete-a-database-using-the-http-api) - [Delete a database using InfluxDB 3 Explorer](#delete-a-database-using-influxdb-3-explorer) +{{% show-in "enterprise" %}}- [Delete data only (preserve schema and resources)](#delete-data-only-preserve-schema-and-resources){{% /show-in %}} ## Delete a database using the influxdb3 CLI @@ -71,3 +72,69 @@ You can also delete databases using the [InfluxDB 3 Explorer](/influxdb3/explore > This action cannot be undone. All data in the database will be permanently deleted. For more information, see [Manage databases with InfluxDB 3 Explorer](/influxdb3/explorer/manage-databases/). + +{{% show-in "enterprise" %}} +## Delete data only (preserve schema and resources) + +{{< product-name >}} supports deleting only the data in a database while preserving the database schema and associated resources. +This is useful when you want to clear old data and re-write new data to the same structure without recreating resources. + +### What is preserved + +When using the data-only deletion option, the following are preserved: + +- **Database schema**: Tables and column definitions +- **Authentication tokens**: Database-scoped access tokens +- **Processing engine configurations**: Triggers and plugin configurations +- **Caches**: Last value caches (LVC) and distinct value caches (DVC) + +### Delete data only using the CLI + +Use the [`--data-only`](/influxdb3/version/reference/cli/influxdb3/delete/database/#options) flag to delete data while preserving the database schema and resources--for example: + +```sh{placeholders="DATABASE_NAME"} +influxdb3 delete database --data-only DATABASE_NAME +``` + +Replace {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}} with the name of your database. + +#### Delete data and remove tables + +To delete data and remove table schemas while preserving database-level resources (tokens, triggers, configurations), combine `--data-only` with [`--remove-tables`](/influxdb3/version/reference/cli/influxdb3/delete/database/#options): + +```sh{placeholders="DATABASE_NAME"} +influxdb3 delete database --data-only --remove-tables DATABASE_NAME +``` + +This preserves: +- Authentication tokens +- Processing engine triggers and configurations + +But removes: +- All data +- Table schemas +- Table-level caches (LVC and DVC) + +### Delete data only using the HTTP API + +To delete only data using the HTTP API, include the `data_only=true` query parameter: + +```bash{placeholders="DATABASE_NAME|AUTH_TOKEN"} +curl --request DELETE "{{< influxdb/host >}}/api/v3/configure/database?db=DATABASE_NAME&data_only=true" \ + --header "Authorization: Bearer AUTH_TOKEN" +``` + +Replace the following: + +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: the name of the database +- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: your {{% token-link "admin" %}} + +#### Delete data and remove tables + +To also remove table schemas, add the `remove_tables=true` parameter: + +```bash{placeholders="DATABASE_NAME|AUTH_TOKEN"} +curl --request DELETE "{{< influxdb/host >}}/api/v3/configure/database?db=DATABASE_NAME&data_only=true&remove_tables=true" \ + --header "Authorization: Bearer AUTH_TOKEN" +``` +{{% /show-in %}} diff --git a/content/shared/influxdb3-admin/databases/list.md b/content/shared/influxdb3-admin/databases/list.md index 54b37cf402..d23d950276 100644 --- a/content/shared/influxdb3-admin/databases/list.md +++ b/content/shared/influxdb3-admin/databases/list.md @@ -27,7 +27,7 @@ The `influxdb3 show databases` command supports output formats: - `json` - `jsonl` - `csv` - +- `parquet` _(must [output to a file](#output-to-a-parquet-file))_ Use the `--format` flag to specify the output format: @@ -79,12 +79,18 @@ noaa {{% /expand %}} {{< /expand-wrapper >}} -#### Output to Parquet +#### Output to a Parquet file -To output your list of databases to a Parquet file, use the `influxdb3 query` command +[Parquet](https://parquet.apache.org/) is a binary format. +Use the `--output` option to specify the file where you want to save the Parquet data. -- `--format`: `parquet` -- `-o`, `--output`: the filepath to the Parquet file to output to +```sh +influxdb3 show databases \ + --format parquet \ + --output databases.parquet +``` + +Alternatively, use the `influxdb3 query` command to query system tables: ```sh influxdb3 query \ diff --git a/content/shared/influxdb3-admin/tables/delete.md b/content/shared/influxdb3-admin/tables/delete.md index 56f35f72d8..022553786c 100644 --- a/content/shared/influxdb3-admin/tables/delete.md +++ b/content/shared/influxdb3-admin/tables/delete.md @@ -13,10 +13,10 @@ You can also schedule a hard deletion to permanently remove the table and its da - [Delete a table using the influxdb3 CLI](#delete-a-table-using-the-influxdb3-cli) - [Delete a table using the HTTP API](#delete-a-table-using-the-http-api) +{{% show-in "enterprise" %}}- [Delete data only (preserve schema and resources)](#delete-data-only-preserve-schema-and-resources){{% /show-in %}} ## Delete a table using the influxdb3 CLI - Use the `influxdb3 delete table` command to delete a table: ```sh{placeholders="DATABASE_NAME|TABLE_NAME|AUTH_TOKEN"} @@ -105,4 +105,51 @@ If the table doesn't exist, the API returns HTTP status `404`: { "error": "Table not found" } -``` \ No newline at end of file +``` + +{{% show-in "enterprise" %}} +## Delete data only (preserve schema and resources) + +{{< product-name >}} supports deleting only the data in a table while preserving the table schema and associated resources. +This is useful when you want to clear old data and re-write new data to the same table structure without recreating resources. + +### What is preserved + +When using the data-only deletion option, the following are preserved: + +- **Table schema**: Column definitions and data types +- **Caches**: Last value caches (LVC) and distinct value caches (DVC) associated with the table + +### Delete data only using the CLI + +Use the [`--data-only`](/influxdb3/version/reference/cli/influxdb3/delete/table/#options) flag to delete data while preserving the table schema and resources: + +```sh{placeholders="DATABASE_NAME|TABLE_NAME|AUTH_TOKEN"} +influxdb3 delete table \ + --database DATABASE_NAME \ + --token AUTH_TOKEN \ + --data-only \ + TABLE_NAME +``` + +Replace the following: + +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: the name of the database containing the table +- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}: the name of the table +- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: your {{% token-link "admin" %}} + +### Delete data only using the HTTP API + +To delete only data using the HTTP API, include the `data_only=true` query parameter: + +```bash{placeholders="DATABASE_NAME|TABLE_NAME|AUTH_TOKEN"} +curl -X DELETE "{{< influxdb/host >}}/api/v3/configure/table?db=DATABASE_NAME&table=TABLE_NAME&data_only=true" \ + --header "Authorization: Bearer AUTH_TOKEN" +``` + +Replace the following: + +- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: the name of the database containing the table +- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}: the name of the table +- {{% code-placeholder-key %}}`AUTH_TOKEN`{{% /code-placeholder-key %}}: your {{% token-link "admin" %}} +{{% /show-in %}} \ No newline at end of file diff --git a/data/products.yml b/data/products.yml index aa5317304c..8bc180a20c 100644 --- a/data/products.yml +++ b/data/products.yml @@ -6,7 +6,7 @@ influxdb3_core: versions: [core] list_order: 2 latest: core - latest_patch: 3.8.0 + latest_patch: 3.9.0 placeholder_host: localhost:8181 detector_config: query_languages: @@ -38,7 +38,7 @@ influxdb3_enterprise: versions: [enterprise] list_order: 2 latest: enterprise - latest_patch: 3.8.0 + latest_patch: 3.9.0 placeholder_host: localhost:8181 detector_config: query_languages: