#NEWLINE# def _fill_constraint_cache( self , db_name , table_name ) : #NEWLINE# #INDENT# schema = self . _get_schema_name ( ) #NEWLINE# ifsc_tables = [ 'constraint_column_usage' , 'key_column_usage' ] #NEWLINE# self . _constraint_cache . setdefault ( db_name , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# self . _constraint_cache [ db_name ] [ table_name ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ifsc_table in ifsc_tables : #NEWLINE# #INDENT# rows = self . execute ( ( '\n                SELECT kc.constraint_name, kc.column_name, c.constraint_type\n                FROM information_schema.%s AS kc\n                JOIN information_schema.table_constraints AS c ON\n                    kc.table_schema = c.table_schema AND\n                    kc.table_name = c.table_name AND\n                    kc.constraint_name = c.constraint_name\n                WHERE\n                    kc.table_schema = %%s AND\n                    kc.table_name = %%s\n            ' % ifsc_table ) , [ schema , table_name ] ) #NEWLINE# for ( constraint , column , kind ) in rows : #NEWLINE# #INDENT# self . _constraint_cache [ db_name ] [ table_name ] . setdefault ( column , set ( ) ) #NEWLINE# self . _constraint_cache [ db_name ] [ table_name ] [ column ] . add ( ( ifsc_table , constraint ) ) #NEWLINE# #UNINDENT# #UNINDENT# return