Skip to content

Allow passing through opts in Ecto.Adapters.SQL.Sandbox.allow/4 calls #678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/ecto/adapters/sql/sandbox.ex
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,11 @@ defmodule Ecto.Adapters.SQL.Sandbox do
"""
@spec allow(Ecto.Repo.t() | pid(), pid(), term()) ::
:ok | {:already, :owner | :allowed} | :not_found
def allow(repo, parent, allow, _opts \\ []) when is_atom(repo) or is_pid(repo) do
def allow(repo, parent, allow, opts \\ []) when is_atom(repo) or is_pid(repo) do
case GenServer.whereis(allow) do
pid when is_pid(pid) ->
%{pid: pool, opts: opts} = lookup_meta!(repo)
%{pid: pool, opts: meta_opts} = lookup_meta!(repo)
opts = Keyword.merge(meta_opts, opts)
DBConnection.Ownership.ownership_allow(pool, parent, pid, opts)

other ->
Expand Down
Loading