From 9d6fedf718d6c885e31f5a46bbade870f9578598 Mon Sep 17 00:00:00 2001 From: Swen Kooij Date: Thu, 6 Apr 2023 16:16:47 +0300 Subject: [PATCH] Pass `get_schema_list` SQL directly to cursor --- psqlextra/backend/introspection.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/psqlextra/backend/introspection.py b/psqlextra/backend/introspection.py index 30e0a5e4..b5bccf7d 100644 --- a/psqlextra/backend/introspection.py +++ b/psqlextra/backend/introspection.py @@ -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):