Using GenServer to load configuration is not only unnecessary, but also harmful. As the server is not running in migrations, if you try to insert data into encrypted field in a data migration, you get misleading error about mismatched ecto types, while the cause is the dump callback unable to access the field configuration.
With runtime.exs configuration file it would be straightforward. Plus, ets woudn't be needed either.
Using GenServer to load configuration is not only unnecessary, but also harmful. As the server is not running in migrations, if you try to insert data into encrypted field in a data migration, you get misleading error about mismatched ecto types, while the cause is the dump callback unable to access the field configuration.
With
runtime.exsconfiguration file it would be straightforward. Plus, ets woudn't be needed either.