You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following on from the discourse conversation here.
When using the settings provider source, it currently isn't possible to assign a prefix to an environment variable name without also having the prefix in the internal setting name. We have written a patch and it seems straightforward enough to allow an optional prefix to be configured in the register_provider block like so:
Application.register_provider(:settings, from: :dry_system) do
prefix { 'SOME_PREFIX_' }
settings do
setting :database_url, constructor: Types::String.constrained(filled: true)
end
I would like to submit a PR for this soon, if maintainers feel it would be helpful!
I would have expected the prefix option to be passed in via register_provider kwarg, I am guessing that you chose a provider method so that the implementation would be limited to the Settings provider?
I wonder if it would be helpful to have some sort of options pass-through from the register_provider method into the provider initialization.
Following on from the discourse conversation here.
When using the settings provider source, it currently isn't possible to assign a prefix to an environment variable name without also having the prefix in the internal setting name. We have written a patch and it seems straightforward enough to allow an optional prefix to be configured in the
register_provider
block like so:I would like to submit a PR for this soon, if maintainers feel it would be helpful!
@solnic also mentioned that:
I agree that would be a nice feature, so I would be happy to implement that too.
The text was updated successfully, but these errors were encountered: