Skip to content

Commit

Permalink
fix: SQLConnector.table_exists() to use separate table_name and `…
Browse files Browse the repository at this point in the history
…schema_name` instead of fully qualified name (#1168)

Co-authored-by: Edgar R. M <edgar@meltano.com>
Fixes #1167
  • Loading branch information
BuzzCutNorman authored Nov 11, 2022
1 parent ff3d65e commit 80daef2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion singer_sdk/connectors/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,11 @@ def table_exists(self, full_table_name: str) -> bool:
Returns:
True if table exists, False if not, None if unsure or undetectable.
"""
_, schema_name, table_name = self.parse_full_table_name(full_table_name)

return cast(
bool,
sqlalchemy.inspect(self._engine).has_table(full_table_name),
sqlalchemy.inspect(self._engine).has_table(table_name, schema_name),
)

def schema_exists(self, schema_name: str) -> bool:
Expand Down

0 comments on commit 80daef2

Please # to comment.