docs: def open(self):
          '''Open a connection to the database.
  
          If a connection appears to be open already, transactions are committed
          and it is closed before proceeding. After establishing the connection,
          the searchIndex table is prepared (and dropped if it already exists).
          '''
          if self.conn is not None:
              self.close()
  
          self.conn = sqlite3.connect(self.filename)
          self.cursor = self.conn.cursor()
  
          c = self.cursor
          c.execute('SELECT name FROM sqlite_master WHERE type="table"')
          if (u'searchIndex',) in c:
              c.execute('DROP TABLE searchIndex')
  
              if self.verbose:
                  print('Dropped existing table', file=sys.stderr)
  
          c.executescript(
              '''
              CREATE TABLE searchIndex
              (id INTEGER PRIMARY KEY, name TEXT, type TEXT, path TEXT);
  
              CREATE UNIQUE INDEX anchor ON searchIndex (name, type, path);
              '''
          )