#NEWLINE# @ reflection . cache #NEWLINE# def get_foreign_keys( self , connection , table_name , schema = None , **kw ) : #NEWLINE# #INDENT# quote = self . identifier_preparer . quote_identifier #NEWLINE# if ( schema is not None ) : #NEWLINE# #INDENT# pragma = ( 'PRAGMA %s.' % quote ( schema ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# pragma = 'PRAGMA ' #NEWLINE# #UNINDENT# qtable = quote ( table_name ) #NEWLINE# statement = ( '%sforeign_key_list(%s)' % ( pragma , qtable ) ) #NEWLINE# c = _pragma_cursor ( connection . execute ( statement ) ) #NEWLINE# fkeys = [ ] #NEWLINE# fks = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# while True : #NEWLINE# #INDENT# row = c . fetchone ( ) #NEWLINE# if ( row is None ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# ( numerical_id , rtbl , lcol , rcol ) = ( row [ 0 ] , row [ 2 ] , row [ 3 ] , row [ 4 ] ) #NEWLINE# self . _parse_fk ( fks , fkeys , numerical_id , rtbl , lcol , rcol ) #NEWLINE# #UNINDENT# return fkeys