def getDb(self, channel):
        currentThread = threading.currentThread()
        if channel not in self.dbCache and currentThread == world.mainThread:
            self.dbCache[channel] = self.makeDb(self.makeFilename(channel))
        if currentThread != world.mainThread:
            db = self.makeDb(self.makeFilename(channel))
        else:
            db = self.dbCache[channel]
        db.isolation_level = None
        return db
Use this to get a database for a specific channel.
dataset/ETHPy150Open ProgVal/Limnoria/plugins/MessageParser/plugin.py/MessageParser.getDb