docs: add examples and clarify usage for token, distinct_cache, and last_cache commands

pull/6002/head
meelahme 2025-04-30 22:41:45 -07:00
parent 88ec6af7a4
commit 85310e1282
3 changed files with 24 additions and 3 deletions

View File

@ -93,6 +93,8 @@ In the example above, replace the following:
Use this simple setup to test the cache functionality for a single tag column. Its helpful when validating basic behavior or building up incrementally.
<!--pytest.mark.skip-->
```bash
influxdb3 create distinct_cache \
--database my_test_db \
@ -105,6 +107,8 @@ influxdb3 create distinct_cache \
Use this pattern when you need more control over cache structure and retention. It creates a multilevel cache with resource limits.
<!--pytest.mark.skip-->
```bash
influxdb3 create distinct_cache \
--database my_test_db \

View File

@ -95,12 +95,12 @@ influxdb3 create last_cache \
my_temp_cache
```
<!--pytest.mark.skip-->
## Create a last value cache with multiple keys and values
This example shows how to configure a more complex cache:
<!--pytest.mark.skip-->
```bash
influxdb3 create last_cache \
--database my_test_db \

View File

@ -1,4 +1,3 @@
The `influxdb3 create token` command creates a new authentication token.
## Usage
@ -33,3 +32,21 @@ influxdb3 create token <SUBCOMMAND>
```bash
influxdb3 create token --admin
```
This returns a token string. You can use it to authenticate future requests by setting it with `--token` or the `INFLUXDB3_AUTH_TOKEN` environment variable.
### Use the token to create a database
<!--pytest.mark.skip-->
```bash
influxdb3 create database \
--token YOUR_ADMIN_TOKEN \
my_new_database
```
> [!Tip]
> Set the token as an environment variable to simplify repeated commands:
> ```bash
> export INFLUXDB3_AUTH_TOKEN=YOUR_ADMIN_TOKEN
> ```