I know this question has been asked already and the answers were always individual answers.
However I've seen Mix.EctoSQL.ensure_started
mentioned quite a bit and it seems as if this is the accepted way to do it.
However with ecto_sql 3.1.2
this functionality has been completely removed (See the commit). It's not obvious to me why it has been removed.
So to sum this question up: is there an accepted way to start ecto, the repo and make sure the logging backend works as expected without writing too much custom code?
The current accepted way of doing this is with
Mix.Task.run("app.start")
Mix.EctoSQL.ensure_started
was a private function, not meant to be used outside of EctoSQL. This new approach is the one recommended by Jose in its place.
It should be noted that this will start your entire application (including background workers or anything else your application would normally start) so you may want to modify your application.ex
file to not start those when started by a mix task.