Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify configuration of the electric app #1889

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

magnetised
Copy link
Contributor

@magnetised magnetised commented Oct 25, 2024

When electric is included as a dependency then the configuration done in our config/runtime.exs is not used, and the application needs to set electric up itself.

Because we've made every configuration option required in the code (relying on runtime.exs) this is onerous.

But, because every option except the db connection actually has sensible defaults, we can simplify this and reduce the required configuration settings down to the db connection stuff.

The only downside to this is that now we have default values for the parameters in two locations, runtime.exs and with every Application.get_env/3 call.

I took the opportunity to re-factor the configuration stuff and move it out of the application.ex module.

TODO

  • document config :electric, :storage_dir, "/my/path"

@magnetised magnetised marked this pull request as draft October 25, 2024 09:36
When electric is included as a dependency then the configuration done in
our `config/runtime.exs` is not used, and the application needs to set
electric up itself.

Because we've made every configuration option required in the code
(relying on runtime.exs) this is onerous.

But, because every option except the db connection actually has sensible
defaults, we can simplify this and reduce the required configuration
settings down to the db connection stuff.

The only downside to this is that now we have default values for the
parameters in two locations, runtime.exs and with every
`Application.get_env/3` call.

I took the opportunity to re-factor the configuration stuff and move it
out of the application.ex module.
@magnetised
Copy link
Contributor Author

NOTE: I'm pausing this until the multi-tenant work is complete as the two have dangerous amounts of overlap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant