@@ -167,8 +167,9 @@ def get_relations(self, cursor, table_name):
167167 rc.UNIQUE_CONSTRAINT_NAME = ccu.CONSTRAINT_NAME
168168 WHERE
169169 tc.TABLE_SCHEMA=@schema_name AND tc.TABLE_NAME=@view_name
170- """ , params = {"schema_name" : schema_name , "view_name" : table_name }
171- )
170+ """ ,
171+ params = {"schema_name" : schema_name , "view_name" : table_name },
172+ )
172173 return {
173174 column : (referred_column , referred_table )
174175 for (column , referred_column , referred_table ) in results
@@ -199,8 +200,9 @@ def get_primary_key_column(self, cursor, table_name):
199200 ccu ON tc.CONSTRAINT_NAME = ccu.CONSTRAINT_NAME
200201 WHERE
201202 tc.TABLE_NAME=@table_name AND tc.CONSTRAINT_TYPE='PRIMARY KEY' AND tc.TABLE_SCHEMA=@schema_name
202- """ , params = {"schema_name" : schema_name , "table_name" : table_name }
203- )
203+ """ ,
204+ params = {"schema_name" : schema_name , "table_name" : table_name },
205+ )
204206 return results [0 ][0 ] if results else None
205207
206208 def get_constraints (self , cursor , table_name ):
@@ -220,13 +222,13 @@ def get_constraints(self, cursor, table_name):
220222
221223 # Firstly populate all available constraints and their columns.
222224 constraint_columns = cursor .run_sql_in_snapshot (
223- '''
225+ """
224226 SELECT
225227 CONSTRAINT_NAME, COLUMN_NAME
226228 FROM
227229 INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE
228- WHERE TABLE_NAME=@table AND TABLE_SCHEMA=@schema_name''' ,
229- params = {"table" : table_name , "schema_name" : schema_name }
230+ WHERE TABLE_NAME=@table AND TABLE_SCHEMA=@schema_name""" ,
231+ params = {"table" : table_name , "schema_name" : schema_name },
230232 )
231233 for constraint , column_name in constraint_columns :
232234 if constraint not in constraints :
@@ -245,14 +247,14 @@ def get_constraints(self, cursor, table_name):
245247
246248 # Add the various constraints by type.
247249 constraint_types = cursor .run_sql_in_snapshot (
248- '''
250+ """
249251 SELECT
250252 CONSTRAINT_NAME, CONSTRAINT_TYPE
251253 FROM
252254 INFORMATION_SCHEMA.TABLE_CONSTRAINTS
253255 WHERE
254- TABLE_NAME=@table AND TABLE_SCHEMA=@schema_name''' ,
255- params = {"table" : quoted_table_name , "schema_name" : schema_name }
256+ TABLE_NAME=@table AND TABLE_SCHEMA=@schema_name""" ,
257+ params = {"table" : quoted_table_name , "schema_name" : schema_name },
256258 )
257259 for constraint , constraint_type in constraint_types :
258260 already_added = constraint in constraints
@@ -298,7 +300,8 @@ def get_constraints(self, cursor, table_name):
298300 idx.TABLE_NAME=@table AND idx.TABLE_SCHEMA=@schema_name
299301 ORDER BY
300302 idx_col.ORDINAL_POSITION
301- """ , params = {"table" : quoted_table_name , "schema_name" : schema_name }
303+ """ ,
304+ params = {"table" : quoted_table_name , "schema_name" : schema_name },
302305 )
303306 for (
304307 index_name ,
@@ -356,7 +359,8 @@ def get_key_columns(self, cursor, table_name):
356359 rc.CONSTRAINT_NAME = ccu.CONSTRAINT_NAME
357360 WHERE
358361 tc.TABLE_NAME=@table AND tc.TABLE_SCHEMA=@schema_name
359- """ , params = {"table" : table_name , "schema_name" : schema_name }
362+ """ ,
363+ params = {"table" : table_name , "schema_name" : schema_name },
360364 )
361365 key_columns .extend (cursor .fetchall ())
362366 return key_columns
0 commit comments