Ecto.Adapters.SQL.Sandbox.start_owner-exclamation-mark

You're seeing just the function start_owner-exclamation-mark, go back to Ecto.Adapters.SQL.Sandbox module for more information.
Link to this function

start_owner!(repo, opts \\ [])

View Source (since 3.4.4)

Starts a process that owns the connection and returns its pid.

The owner process is not linked to the caller, it is your responsibility to ensure it will be stopped. In tests, this is done by terminating the pool in an ExUnit.Callbacks.on_exit/2 callback:

setup tags do
  pid = Ecto.Adapters.SQL.Sandbox.start_owner!(MyApp.Repo, shared: not tags[:async])
  on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
  :ok
end

Options

  • :shared - if true, the pool runs in the shared mode. Defaults to false

The remaining options are passed to checkout/2.