queryRaw method

Future<String> queryRaw(
  1. dynamic fluxQuery, {
  2. Dialect? dialect,
  3. Map<String, Object>? params,
})

Gets the result of fluxQuery as a raw string.

Use this with care, all response is stored in memory. Result CSV format can be changed using dialect.

Implementation

Future<String> queryRaw(fluxQuery,
    {Dialect? dialect, Map<String, Object>? params}) async {
  var query = fluxQuery is Query ? fluxQuery : Query(query: fluxQuery);

  query.params = params ?? query.params;
  query.dialect = dialect ?? query.dialect;

  var response = await _send('/api/v2/query', {'org': influxDB.org}, query);
  return (response as StreamedResponse).stream.bytesToString();
}