Skip to content

Commit a87eb15

Browse files
committed
Pass get_schema_list SQL directly to cursor
1 parent 4b9cf2a commit a87eb15

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

psqlextra/backend/introspection.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,16 @@ def get_columns(self, cursor, table_name: str):
194194
def get_schema_list(self, cursor) -> List[str]:
195195
"""A flat list of available schemas."""
196196

197-
sql = """
197+
cursor.execute(
198+
"""
198199
SELECT
199200
schema_name
200201
FROM
201202
information_schema.schemata
202-
"""
203+
""",
204+
tuple(),
205+
)
203206

204-
cursor.execute(sql, tuple())
205207
return [name for name, in cursor.fetchall()]
206208

207209
def get_constraints(self, cursor, table_name: str):

0 commit comments

Comments
 (0)