elixir-ecto / db_connection

Database connection behaviour
http://hexdocs.pm/db_connection/DBConnection.html
309 stars 112 forks source link

Allow configuring pool_size with env vars #61

Closed whoward closed 8 years ago

whoward commented 8 years ago

It would be great if we could tune the pool size using an environment variable - it doesn't currently seem to work. We can do this with other configuration parameters like url in the form of {:system, "ENV_VAR_NAME"}

fishcakez commented 8 years ago

Hi @whoward. DBConnection is very low level and doesn't support any application or system env, it only does explicit keyword list options. Likely you want to open this in ecto where the configuration for url etc is handled. You may also be interested in https://github.com/phoenixframework/phoenix/issues/1730.

whoward commented 8 years ago

ok i'll move this to ecto - sadly you can't use System.get_env in the configuration file because its 'baked in' at compile time, hence the {:system, "ENV_VAR_NAME"} pattern's purpose for existing

fishcakez commented 8 years ago

@whoward do you mean baked in at release build time? This is not quite the same as compile time, as it will work when using mix run etc.

whoward commented 8 years ago

yeah release build time :) using exrm or distillery

michalmuskala commented 8 years ago

AFAIK ecto supports the {:system, "VAR_NAME"} idiom for the :url option since a long time

fishcakez commented 8 years ago

Discussion moved here: https://groups.google.com/forum/#!topic/elixir-ecto/BiWJvWbUDc0

@michalmuskala this is about doing a similar thing to :url for :pool_size