Algatux / influxdb-bundle

Bundle service integration of official influxdb/influxdb-php client
MIT License
24 stars 14 forks source link

Support a DSN for connections #83

Closed dkarlovi closed 3 years ago

dkarlovi commented 6 years ago

If using this bundle with Symfony Flex, the established approach is to support a DSN for connection strings instead of having each individual part be separate, as is currently the case.

This allow to pass the connection string as one variable instead of several (up to 5) which significantly simplifies secrets management for containerized apps, you just put the entire DSN in the secret.

Here's an example usage by Doctrine Bundle in a Symfony Flex recipe: https://github.com/symfony/recipes/blob/master/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml#L18

Algatux commented 6 years ago

@dkarlovi this can be a good idea and an improvement.

dkarlovi commented 6 years ago

@Algatux I think so too.

You could have something like:

influx_db:
    connections:
        udp_conn:
            url: influxdb+udp://user:password@host:4444/database
        http_conn:
            url: influxdb+http://user:password@host:8086/database

Maybe the influxdb prefix is not even needed, what do you think?

Algatux commented 6 years ago

@dkarlovi yes it is not needed IMHO

dkarlovi commented 6 years ago

Would you take a PR for this?

Algatux commented 6 years ago

@dkarlovi a non bc PR will be welcome!