But what if I want to read it from a data store, or the database, or a variety of other places.
A whole configuration handling overhaul has been discussed on the forums not long ago: https://elixirforum.com/t/proposal-moving-towards-discoverable-config-files/14302 For now, https://hex.pm/packages/confex is a decent'ish shim that works well enough for build-time configurations though. :-) But overall, things like that seem more suited for a configuration library (that should be included in Elixir once it is sufficiently generic enough and staged enough), though environment variables are common for the configs, that doesn't mean that someone really doesn't just want `{:system, var}` returned straight though, as can be the case.. :-) On Monday, August 6, 2018 at 1:15:08 PM UTC-6, Ivan Yurov wrote: > > While playing with deployment I found out that some libraries provide this > feature that you can put {:system, var} in configuration and then it's > resolved at runtime. However if it's in my code, I'd have to implement it > on my own. Wouldn't it be nice if it was supported by Application module by > default? Something like: > def get_env(app, key, default \\ nil) do > case :application.get_env(app, key, default) do > {:system, var} -> > System.get_env(var) || default > rest -> > rest > end > end > > Would it make sense? > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/303f119a-cd33-4729-8585-8d9134ae8929%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
