From 645ec64b411bb62b862f616a10f0c76b3e0ab508 Mon Sep 17 00:00:00 2001 From: Nathan Long Date: Mon, 17 Nov 2025 11:05:22 -0500 Subject: [PATCH 1/2] Label the connection with the repo name See https://github.com/elixir-ecto/db_connection/pull/332 --- lib/ecto/adapters/sql.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ecto/adapters/sql.ex b/lib/ecto/adapters/sql.ex index 68604e47..945527eb 100644 --- a/lib/ecto/adapters/sql.ex +++ b/lib/ecto/adapters/sql.ex @@ -890,7 +890,10 @@ defmodule Ecto.Adapters.SQL do {name, config} = Keyword.pop(config, :name, config[:repo]) {pool_count, config} = Keyword.pop(config, :pool_count, 1) {pool, config} = pool_config(config) - child_spec = connection.child_spec(config) + + connection_config = Keyword.put(config, :label, name) + + child_spec = connection.child_spec(connection_config) meta = %{ telemetry: telemetry, From 2e01d956a164a5860c506f6bd4d9a74582c58fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 17 Nov 2025 13:55:52 -0800 Subject: [PATCH 2/2] Update lib/ecto/adapters/sql.ex --- lib/ecto/adapters/sql.ex | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/ecto/adapters/sql.ex b/lib/ecto/adapters/sql.ex index 945527eb..e7631b8a 100644 --- a/lib/ecto/adapters/sql.ex +++ b/lib/ecto/adapters/sql.ex @@ -890,10 +890,7 @@ defmodule Ecto.Adapters.SQL do {name, config} = Keyword.pop(config, :name, config[:repo]) {pool_count, config} = Keyword.pop(config, :pool_count, 1) {pool, config} = pool_config(config) - - connection_config = Keyword.put(config, :label, name) - - child_spec = connection.child_spec(connection_config) + child_spec = connection.child_spec([label: name] ++ config) meta = %{ telemetry: telemetry,