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 30, 2023
1 parent da34539 commit 945bbb1
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 @@ -833,7 +833,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 @@ -851,7 +851,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 @@ -865,7 +865,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 945bbb1

Please sign in to comment.