Exemplo n.º 1
0
 def save_db(self):
     """
     Save module results into the database
     """
     logger.log('DEBUG', f'Saving results to database')
     lock.acquire()
     db = Database()
     db.create_table(self.domain)
     db.save_db(self.domain, self.results, self.source)
     db.close()
     lock.release()
Exemplo n.º 2
0
def save_db(name, data, module):
    """
    Save request results to database

    :param str  name: table name
    :param list data: data to be saved
    :param str module: module name
    """
    db = Database()
    db.drop_table(name)
    db.create_table(name)
    db.save_db(name, data, module)
    db.close()