Skip to content

Commit 4af9f13

Browse files
authored
Allow pid repos in Ecto.Adapters.SQL.table_exists? (#729)
Closes #728.
1 parent 91c6f8a commit 4af9f13

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/ecto/adapters/sql.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ defmodule Ecto.Adapters.SQL do
710710
The table is checked against the current database/schema in the connection.
711711
"""
712712
@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
713+
def table_exists?(repo, table, opts \\ []) when is_atom(repo) or is_pid(repo) do
714714
%{sql: sql} = adapter_meta = Ecto.Adapter.lookup_meta(repo)
715715
{query, params} = sql.table_exists_query(table)
716716
query!(adapter_meta, query, params, opts).num_rows != 0

0 commit comments

Comments
 (0)