def get(self, item, defValue, justPresent = True):
        cu = self.db.cursor()

        if justPresent:
            pres = " AND isPresent=1"
        else:
            pres = ""

        cu.execute("SELECT instanceId FROM Instances WHERE "
                        "troveName=? AND versionId=? AND "
                        "flavorId=? %s" % pres, item)
        item = cu.fetchone()
        if not item:
            return defValue
        return item[0]