def __init__(self, db, table, fields):
        self.db = db
        self.table = table
        self.sql = "INSERT INTO %s (%s) VALUES (%s)" % (
            table, ", ".join(fields), ",".join(["?"]*len(fields)))
        self.cu = self.db.cursor()
        # check the fields are all present in the target
        self.cu.execute("SELECT * FROM %s LIMIT 1" % (table,))
        set1 = set([x.lower() for x in fields])
        set2 = set([x.lower() for x in self.cu.fields()])
        assert (set1.difference(set2) == set()), "Fields differ from src to target: %s %s" %(set1, set2)
        self.fields = fields
        # make sure we know when to use cu.binary()
        self.funcs = [ self.__getfunc(x) for x in fields ]
dataset/ETHPy150Open sassoftware/conary/scripts/migration/database.py/Loader.__init__/original