We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91c6f8a commit 4af9f13Copy full SHA for 4af9f13
1 file changed
lib/ecto/adapters/sql.ex
@@ -710,7 +710,7 @@ defmodule Ecto.Adapters.SQL do
710
The table is checked against the current database/schema in the connection.
711
"""
712
@spec table_exists?(Ecto.Repo.t(), table :: String.t(), opts :: Keyword.t()) :: boolean
713
- 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
714
%{sql: sql} = adapter_meta = Ecto.Adapter.lookup_meta(repo)
715
{query, params} = sql.table_exists_query(table)
716
query!(adapter_meta, query, params, opts).num_rows != 0
0 commit comments