Hello, I'd vote for this change too, actually found that and other discussion, when I was going to make exact same proposal, and just did a quick search first. Then only notable stopper I've seen is that values would be strong, whilist user may expect int/bool etc. I think we could handle this case by passing some typing info in first element, like {:system_int, "POOL_SIZE"} etc, which would evaluate to nil if env isn't set or not an integer.
On Saturday, December 17, 2016 at 3:17:35 PM UTC+6, José Valim wrote: > There has been a couple discussions on the topic either here or on the issues > tracker. > > > The consensus is that this problem needs to be solved but we are not quite > sure how. The only way to support {:system, "DATABASE_URL"} in a way that it > would also work for Erlang applications is by hijacking the application > controller using private APIs. We could also try solve this exclusively for > Elixir but then there would be gaps where it wouldn't be supported. > > > Ecto 2.1 is trying a new approach where the value is configured using a > repository callback, that's what we will try to do when Phoenix 1.3 comes out > and see where it will lead us to. > > > > > > > > > > > > José Valim > > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > > On Sat, Dec 17, 2016 at 1:48 AM, Cory ODaniel <co...@coryodaniel.com> wrote: > > I've definitely run into issues where I need to pass an environment variable > at run time, but an application that I use doesn't support the {:system, > "DATABASE_URL"} or {:system, "PORT"} style environment variables that Ecto > and Phoenix support. > > > I'm curious if it would be beneficial to add support in Application.get_env/2 > that when the value that returns matches {:system, var} then > System.get_env(var) would be called under the hood. > > > > > > > -- > > You received this message because you are subscribed to the Google Groups > "elixir-lang-core" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email to elixir-lang-co...@googlegroups.com. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/9fd6e998-04d2-4d7d-87ee-34abb16ee779%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/95024359-4928-4ccd-997f-c8c2a1b614c4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.