|
|
@ -11,6 +11,7 @@ class Searcher: |
|
|
self.cur = ext_database.cursor() |
|
|
self.cur = ext_database.cursor() |
|
|
self.ext = ext |
|
|
self.ext = ext |
|
|
self.index = '{}_index'.format(ext) |
|
|
self.index = '{}_index'.format(ext) |
|
|
|
|
|
self.__init_table__() |
|
|
def __init_table__(self): |
|
|
def __init_table__(self): |
|
|
self.cur.execute('CREATE TABLE IF NOT EXISTS ? (`name` TEXT,`fullpath` TEXT,UNIQUE(name,fullpath));',[self.ext]) |
|
|
self.cur.execute('CREATE TABLE IF NOT EXISTS ? (`name` TEXT,`fullpath` TEXT,UNIQUE(name,fullpath));',[self.ext]) |
|
|
self.cur.execute('CREATE INDEX IF NOT EXISTS ? ON ? ( `name`, `fullpath` )',[self.index,self.ext]) |
|
|
self.cur.execute('CREATE INDEX IF NOT EXISTS ? ON ? ( `name`, `fullpath` )',[self.index,self.ext]) |
|
|
|