#NEWLINE# @ reflection . cache #NEWLINE# def get_indexes( 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# include_auto_indexes = kw . pop ( 'include_auto_indexes' , False ) #NEWLINE# qtable = quote ( table_name ) #NEWLINE# statement = ( '%sindex_list(%s)' % ( pragma , qtable ) ) #NEWLINE# c = _pragma_cursor ( connection . execute ( statement ) ) #NEWLINE# indexes = [ ] #NEWLINE# while True : #NEWLINE# #INDENT# row = c . fetchone ( ) #NEWLINE# if ( row is None ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( not include_auto_indexes ) and row [ 1 ] . startswith ( 'sqlite_autoindex' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# indexes . append ( dict ( name = row [ 1 ] , column_names = [ ] , unique = row [ 2 ] ) ) #NEWLINE# #UNINDENT# for idx in indexes : #NEWLINE# #INDENT# statement = ( '%sindex_info(%s)' % ( pragma , quote ( idx [ 'name' ] ) ) ) #NEWLINE# c = connection . execute ( statement ) #NEWLINE# cols = idx [ 'column_names' ] #NEWLINE# while True : #NEWLINE# #INDENT# row = c . fetchone ( ) #NEWLINE# if ( row is None ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# cols . append ( row [ 2 ] ) #NEWLINE# #UNINDENT# #UNINDENT# return indexes