PG
Size: a a a
PG
AB
|> Supervisor.which_children()
|> Enum.flat_map(fn({_, pid, _, _}) -> Supervisor.which_children(pid) end)
|> Enum.filter(fn({name, _, _, _}) -> name == MyCustomSupervisor end)
fn({name, _, _, _}).AB
VA
AB
VA
:supervisorVA
MyCustomSupervisor. И мне охота их всех взять. Можно регистри воспользоваться. Но там задача считай одноразовая - влом.LL
|> Supervisor.which_children()
|> Enum.flat_map(fn({_, pid, _, _}) -> Supervisor.which_children(pid) end)
|> Enum.filter(fn({name, _, _, _}) -> name == MyCustomSupervisor end)
fn({name, _, _, _}).|> Enum.filter(& match? {CustomSupervisor, _, _, _}, &1)VA
|> Enum.filter(& match? {CustomSupervisor, _, _, _}, &1)VA
|> Enum.filter(& match? {CustomSupervisor, _, _, _}, &1)match?LL
fn(x) -> x + 2 endfn x -> x + 2 endLL
match?VA
LL
VA
LL
Xandra ? Расскажете про свой опыт, ощущения?ŹR
AB
AB
Ecto.Query.Planner.plan(q, :all, Ecto.Adapters.Postgres)Ecto.Adapter.Queryable.plan_query(:all, Ecto.Adapters.Postgres, q)AB
alias Ecto.Query, as: Q
...
# create query
Q.from("left", as: :l)
|> Q.join(:left, [l: le], r in "right", on: r.id == le.r_id, as: :r)
|> Q.select([l: le, r: ri], {le.id, ri.id})
# translate to sql
|> (&Ecto.Adapter.Queryable.plan_query(:all, Ecto.Adapters.Postgres, &1)).() |> elem(0)
|> Ecto.Adapters.Postgres.Connection.all()
|> List.to_string