Skip to content

Instantly share code, notes, and snippets.

@chasers
Created October 25, 2023 20:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chasers/e4aa33625e6ea39ecb89f03383dd9e38 to your computer and use it in GitHub Desktop.
Save chasers/e4aa33625e6ea39ecb89f03383dd9e38 to your computer and use it in GitHub Desktop.
Finds DBConnection processes from Process.info
Enum.each(Process.list, fn pid ->
case Process.info(pid)[:dictionary] do
[_, "$initial_call": {:supervisor, DBConnection.ConnectionPool.Pool, _}] ->
state = :sys.get_state(pid, 5000)
case elem(state, 11) do
{pid, _, Postgrex.Protocol, opts} ->
if opts[:hostname] == "db.REDACTED.supabase.co" do
IO.inspect({pid, state})
end
_ -> nil
end
_ -> nil
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment