Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Need process for dynamically setting database port/host. #587
I run elixir within a docker instance and need the ability to set the database port/host at runtime from :os.environment variables.
The ability to set credentials via environment variables is also a common requirement for build systems where database details may not be known in advance. Is there already the ability to do this with the current code base. I've glanced things over for a bit but am fairly new to elixir/erlang and didn't spot an instance of this being done, nor do I know what the standard idiom would be to do so if the system follows some standard idiom that passes values in via start link settings etc.
If ability is available let me know the rough steps and I'll fork and update your docs for you with details. If not I'll go in and implement the capability for you.
Much thanks in advance. This library is a great resource either way ^_^.
ack, that works. Thanks for the prompt reply that was killing me.
On Fri, May 8, 2015 at 7:57 PM, José Valim email@example.com wrote:
port: System.get_env("MYSQL_PORT_3306_TCP_PORT") |> Integer.parse |> elem(0),
since matching fails on String Port.
note, allowing for matching on String Port followed by integer parse might save some users config headaches in the future.