Skip to content

Commit

Permalink
Passes all tests, squashed some bugs!
Browse files Browse the repository at this point in the history
  • Loading branch information
visch committed Feb 21, 2024
1 parent 8c2d124 commit 8809b65
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tap_mysql/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,17 @@ def __init__(self, *args: tuple[Any, ...], **kwargs: dict[str, Any]) -> None:
"variable_name='version_comment' and variable_value like "
"'PlanetScale%%'"
)
if output.rowcount > 0:
rows = output.fetchall()
if len(rows) > 0:
self.logger.info(
"Instance has been detected to be a "
"Vitess (PlanetScale) instance, using Vitess "
"configuration."
)
self.is_vitess = True
output.close()
self.logger.info(
"Instance is not a Vitess instance, using standard configuration."
)

@staticmethod
def to_jsonschema_type(
Expand Down Expand Up @@ -366,7 +369,7 @@ def get_table_columns(
An ordered list of column objects.
"""
if self.is_vitess is False:
return self.get_table_columns(full_table_name, column_names)
return super().get_table_columns(full_table_name, column_names)
# If Vitess Instance then we can't use DESCRIBE as it's not supported
# for views so we do below
if full_table_name not in self._table_cols_cache:
Expand Down

0 comments on commit 8809b65

Please sign in to comment.