From 14140ce401d4241162d394afd86b9ff5e50d247c Mon Sep 17 00:00:00 2001 From: simoncse Date: Mon, 4 May 2026 17:10:03 +0800 Subject: [PATCH] Fixed Ecto.Adapters.SQL.table_exists? missing guard clause (should allow repo as pid) --- lib/ecto/adapters/sql.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ecto/adapters/sql.ex b/lib/ecto/adapters/sql.ex index 88d3d913..50abd82a 100644 --- a/lib/ecto/adapters/sql.ex +++ b/lib/ecto/adapters/sql.ex @@ -710,7 +710,7 @@ defmodule Ecto.Adapters.SQL do The table is checked against the current database/schema in the connection. """ @spec table_exists?(Ecto.Repo.t(), table :: String.t(), opts :: Keyword.t()) :: boolean - def table_exists?(repo, table, opts \\ []) when is_atom(repo) do + def table_exists?(repo, table, opts \\ []) when is_atom(repo) or is_pid(repo) do %{sql: sql} = adapter_meta = Ecto.Adapter.lookup_meta(repo) {query, params} = sql.table_exists_query(table) query!(adapter_meta, query, params, opts).num_rows != 0