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.
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
- iftrue
, the pool runs in the shared mode. Defaults tofalse
The remaining options are passed to checkout/2
.