Ecto.Adapters.SQL.Sandbox.checkout

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

checkout(repo, opts \\ [])

View Source

Checks a connection out for the given repo.

The process calling checkout/2 will own the connection until it calls checkin/2 or until it crashes in which case the connection will be automatically reclaimed by the pool.

Options

  • :sandbox - when true the connection is wrapped in a transaction. Defaults to true.

  • :isolation - set the query to the given isolation level.

  • :ownership_timeout - limits how long the connection can be owned. Defaults to the value in your repo config in config/config.exs (or preferably in config/test.exs), or 120000 ms if not set. The timeout exists for sanity checking purposes, to ensure there is no connection leakage, and can be bumped whenever necessary.