influxdata / influxdb-client-dart

InfluxDB (v2+) Client Library for Dart and Flutter
MIT License
25 stars 10 forks source link

InfluxDB 1.8 compatibility #68

Closed JohanScheepers closed 2 years ago

JohanScheepers commented 2 years ago

The documentation state compatible with InfluxDB 1.8, where in 1.8 do you find org and buckets?

InfluxDB 1.8 API compatibility var client = InfluxDBClient( url: 'http://localhost:8086', username: '...', password: '...', org: 'my-org', bucket: 'my-bucket', debug: true);

bednar commented 2 years ago

Hi @JohanScheepers,

thanks for using our client.

The documentation is not correct... you can use following code to connect into 1.8:

var database = 'mydb';
var retentionPolicy = 'autogen';
var client = InfluxDBClient(
  url: 'http://localhost:8086',
  bucket: '$database/$retentionPolicy',
  username: 'my-username',
  password: 'my-password'
);

Regards