Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database name when using InfluxDB #548

Closed
tempuser14 opened this issue Dec 21, 2018 · 1 comment
Closed

Database name when using InfluxDB #548

tempuser14 opened this issue Dec 21, 2018 · 1 comment

Comments

@tempuser14
Copy link

Every time I want to run a Query or write some batch points I need to pass the database name, although it is already configured in the InfluxDB instance. E.g:
0. InfluxDB influxDb = InfluxDBFactory.connect(url, username, password).setDatabase(DB_NAME_INFLUX);

  1. BatchPoints batchPoints = BatchPoints.database(DB_NAME_INFLUX)
  2. new Query(QUERY_STRING, DB_NAME_INFLUX)

and then
influxDb .query(query); //but influxDB is already configured with a DB name

Basically one needs to pass it over and over again and it is a design smell to me.
A solution could be that queries and BatchPoints do not require a database name, and this is set on execution by the InfluxDB instance if empty. Other database APIs where a Connection-instance (i.e InfluxDB instance) per database is forced seem more clear.

@majst01
Copy link
Collaborator

majst01 commented Dec 22, 2018

You are right,

one of the challenges when writing libraries, used by many users, is not breaking the api and not make the api so broad that noone understand it. So this particular issues is from the early days.

If you have an approach to solve that in a way that it doesnt break actual users, and does not introduce much additions to the api, im interested in reviewing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants