Skip to content

Commit

Permalink
Pass get_schema_list SQL directly to cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
Photonios committed Apr 6, 2023
1 parent b757d69 commit 9d6fedf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions psqlextra/backend/introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,16 @@ def get_partition_key(self, cursor, table_name: str) -> List[str]:
def get_schema_list(self, cursor) -> List[str]:
"""A flat list of available schemas."""

sql = """
cursor.execute(
"""
SELECT
schema_name
FROM
information_schema.schemata
"""
""",
tuple(),
)

cursor.execute(sql, tuple())
return [name for name, in cursor.fetchall()]

def get_constraints(self, cursor, table_name: str):
Expand Down

0 comments on commit 9d6fedf

Please sign in to comment.