Skip to content

Commit

Permalink
Fix reflection bug for case-sensitive schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
fordhoka committed Nov 27, 2023
1 parent 333d966 commit 920aee0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/snowflake/sqlalchemy/snowdialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ def get_schema_names(self, connection, **kw):
@reflection.cache
def get_sequence_names(self, connection, schema=None, **kw):
sql_command = "SHOW SEQUENCES {}".format(
f"IN SCHEMA {self.normalize_name(schema)}" if schema else ""
f" IN SCHEMA \"{self.denormalize_name(schema)}\"" if schema else "",
)
try:
cursor = connection.execute(text(sql_command))
Expand All @@ -819,7 +819,7 @@ def _get_table_comment(self, connection, table_name, schema=None, **kw):
"SHOW /* sqlalchemy:_get_table_comment */ "
"TABLES LIKE '{}'{}".format(
table_name,
f" IN SCHEMA {self.normalize_name(schema)}" if schema else "",
f" IN SCHEMA \"{self.denormalize_name(schema)}\"" if schema else "",
)
)
cursor = connection.execute(text(sql_command))
Expand All @@ -833,7 +833,7 @@ def _get_view_comment(self, connection, table_name, schema=None, **kw):
"SHOW /* sqlalchemy:_get_view_comment */ "
"VIEWS LIKE '{}'{}".format(
table_name,
f" IN SCHEMA {self.normalize_name(schema)}" if schema else "",
f" IN SCHEMA \"{self.denormalize_name(schema)}\"" if schema else "",
)
)
cursor = connection.execute(text(sql_command))
Expand Down

0 comments on commit 920aee0

Please sign in to comment.