Let libraries be libraries

I do agree that that direction is more natural, but you can also do it the other way round. Wrap the repo functions with calls doing put_dynamic_repo. You can already start an ecto repo with a different name, which includes the connection pool. I do all that in a project of mine, where I deal with catalogs provided as sqlite dbs. I agree that the apis and ectos process tree are not optimal due to legacy reasons, but ecto added all the pieces needed to deal with dynamically run repos as well.

1 Like