diff --git a/CHANGES.md b/CHANGES.md index 246c7470..78e08524 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ ## Unreleased +- IO: Added the `if-exists` query parameter by updating to influxio 0.4.0. ## 2024/06/18 v0.0.14 - Add `ctk cfr` and `ctk wtf` diagnostics programs diff --git a/doc/io/influxdb/loader.md b/doc/io/influxdb/loader.md index a4d432c8..36b7ec44 100644 --- a/doc/io/influxdb/loader.md +++ b/doc/io/influxdb/loader.md @@ -16,7 +16,7 @@ working with InfluxDB. pip install --upgrade 'cratedb-toolkit[influxdb]' ``` -## Examples +## Usage ### Workstation @@ -66,5 +66,26 @@ ctk load table \ --cratedb-sqlalchemy-url="crate://admin:dZ...6LqB@green-shaak-ti.eks1.eu-west-1.aws.cratedb.net:4200/testdrive/demo?ssl=true" ``` +## Parameters + +### `if-exists` + +The target table will be created automatically, if it does not exist. If it +does exist, the `if-exists` URL query parameter can be used to configure this +behavior. The default value is `fail`, the possible values are: + +* `fail`: Raise a ValueError. +* `replace`: Drop the table before inserting new values. +* `append`: Insert new values to the existing table. + +:::{rubric} Example usage +::: +In order to always replace the target table, i.e. to drop and re-create it +prior to inserting data, use `?if-exists=replace`. +```shell +export CRATEDB_SQLALCHEMY_URL="crate://crate@localhost:4200/testdrive/demo?if-exists=replace" +ctk load table influxdb2://example:token@localhost:8086/testdrive/demo +``` + [influxio]: inv:influxio:*:label#index diff --git a/pyproject.toml b/pyproject.toml index 85b3ad6e..8c99b7e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -140,7 +140,7 @@ full = [ ] influxdb = [ "cratedb-toolkit[io]", - "influxio>=0.3.1,<1", + "influxio>=0.4,<1", ] io = [ "cr8",