Class QueryOptions


  • @ThreadSafe
    public final class QueryOptions
    extends Object
    Query API options.

    Supports to specify:

    • database - specifies the database to be used for InfluxDB operations
    • queryType - specifies the type of query sent to InfluxDB. Default to 'SQL'.
    • Field Detail

      • DEFAULTS

        public static final QueryOptions DEFAULTS
        Default QueryAPI options.
      • INFLUX_QL

        public static final QueryOptions INFLUX_QL
        Default QueryAPI options for InfluxQL.
    • Constructor Detail

      • QueryOptions

        public QueryOptions​(@Nonnull
                            String database)
        Construct QueryAPI options.
        Parameters:
        database - The database to be used for InfluxDB operations.
      • QueryOptions

        public QueryOptions​(@Nonnull
                            QueryType queryType)
        Construct QueryAPI options.
        Parameters:
        queryType - The type of query sent to InfluxDB.
      • QueryOptions

        public QueryOptions​(@Nullable
                            String database,
                            @Nullable
                            QueryType queryType)
        Construct QueryAPI options.
        Parameters:
        database - The database to be used for InfluxDB operations. If it is not specified then use ClientConfig.getDatabase().
        queryType - The type of query sent to InfluxDB. If it is not specified then use QueryType.SQL.
    • Method Detail

      • databaseSafe

        @Nullable
        public String databaseSafe​(@Nonnull
                                   ClientConfig config)
        Parameters:
        config - with default value
        Returns:
        The destination database for writes.
      • queryTypeSafe

        @Nonnull
        public QueryType queryTypeSafe()
        Returns:
        The type of query sent to InfluxDB, cannot be null.