'Removes the host scan result. "host" must be a record as yielded by
.get() or a valid NmapFilter() instance.
The scan files that are no longer linked to a scan are removed
at the end of the call.'

def remove(self, host, archive=False):

    if isinstance(host, dict):
        base = [host['_id']]
    else:
        base = host.query(select([Scan.id]), archive=archive).cte('base')
    self.db.execute(delete(Scan).where(Scan.id.in_(base)))
    base = select([Association_Scan_ScanFile.scan_file]).cte('base')
    self.db.execute(delete(ScanFile).where(ScanFile.sha256.notin_(base)))
