Questions on Async code using Ecto

  1. I do not know if it would be possible while keeping all niceties of SQL.Sandbox (especially fact that everything is ran within single transaction, which allows asynchronous testing with Postgres).
  2. There is documentation of Ecto.Adapters.SQL.Sandbox.
  3. Yes, Ecto checks out new connection from pool for each insert unless you will do it on your own via Repo.transaction or Repo.checkout
  4. It depends on the task. You can even test it synchronously if you want. There is no “one-fit-them-all” solution.