Lists the page's N+1 queries in a footer and in the browser console while you develop.
Add it to the browser pipeline in dev only since the footer shows SQL and file paths to anyone who loads the page.
if Application.compile_env(:my_app, :dev_routes) do
plug EctoDoctor.Plug
endIt shows nothing until N+1 detection is attached, so attach it when the app starts in dev.
# lib/my_app/application.ex in start/2
if Application.get_env(:my_app, :dev_routes) == true and
Code.ensure_loaded?(EctoDoctor.RepeatedQueries) do
EctoDoctor.RepeatedQueries.attach(repo: MyApp.Repo)
endThe footer lists every N+1 on the page, even ones the baseline file knows.
Pass nonce: :csp_nonce when a content security policy needs a nonce from that assign.