#NEWLINE# @ reflection . cache #NEWLINE# def get_unique_constraints( self , connection , table_name , schema = None , **kw ) : #NEWLINE# #INDENT# UNIQUE_SQL = "\n            SELECT sql\n            FROM\n                sqlite_master\n            WHERE\n                type='table' AND\n                name=:table_name\n        " #NEWLINE# c = connection . execute ( UNIQUE_SQL , table_name = table_name ) #NEWLINE# table_data = c . fetchone ( ) [ 0 ] #NEWLINE# UNIQUE_PATTERN = 'CONSTRAINT (\\w+) UNIQUE \\(([^\\)]+)\\)' #NEWLINE# return [ { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'column_names' : [ col . strip ( ' "' ) for col in cols . split ( ',' ) ] , #NEWLINE# #UNINDENT# } for ( name , cols ) in re . findall ( self , table_data ) ]