Manage tables
Tables are synonymous with measurements in InfluxDB 3 Core. They are typically created automatically when you write line protocol data, but you can also manually create them to define custom schemas or apply settings. before writing data.
Create a table
Use the influxdb3 CLI or HTTP API to create a table in a specified database in InfluxDB 3 Core.
# influxdb3 CLI
influxdb3 create table \
--tags tag1,tag2,tag3 \
--database DATABASE_NAME \
--token AUTH_TOKEN \
TABLE_NAME
# HTTP API
curl -X POST "http://localhost:8181/api/v3/configure/table" \
--header "Authorization: Bearer AUTH_TOKEN" \
--header "Content-Type: application/json" \
--data '{"db": "DATABASE_NAME", "table": "TABLE_NAME", "tags": ["tag1", "tag2", "tag3"]}'
List tables
Use the influxdb3 CLI or HTTP API to list tables in a specified database in InfluxDB 3 Core. Use SQL SHOW TABLES or InfluxQL SHOW MEASUREMENTS statements.
# influxdb3 CLI
influxdb3 query \
--database DATABASE_NAME \
--token AUTH_TOKEN \
"SHOW TABLES"
# HTTP API
curl --get "http://localhost:8181/api/v3/query_sql" \
--header "Authorization: Bearer AUTH_TOKEN" \
--data-urlencode "db=DATABASE_NAME" \
--data-urlencode "q=SHOW TABLES"
Delete a table
Use the influxdb3 delete table
command or the HTTP API to delete a table from a specified database in InfluxDB 3 Core. Supports both soft delete and hard delete operations.
# CLI
influxdb3 delete table \
--database <DATABASE_NAME> \
--token <AUTH_TOKEN> \
<TABLE_NAME>
# HTTP API
curl -X DELETE "http://localhost:8181/api/v3/configure/table?db=<DATABASE_NAME>&table=<TABLE_NAME>" \
--header "Authorization: Bearer <AUTH_TOKEN>"
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB 3 Core and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.