v1.databases() function

Warning! This page documents an earlier version of Flux, which is no longer actively developed. Flux v0.65 is the most recent stable version of Flux.

The v1.databases() function returns a list of databases in an InfluxDB 1.7+ instance.

import "influxdata/influxdb/v1"

v1.databases()

Output includes the following columns:

  • databaseName: Database name (string)
  • retentionPolicy: Retention policy name (string)
  • retentionPeriod: Retention period in nanoseconds (integer)
  • default: Default retention policy for database (boolean)

SHOW DATABASES