<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_table(self, table, pks=['id']):
 """ Update records in a database table from the main dataframe """

        if self._check_db() is False:
            return
        try:
            table = self.db[table]
        except Exception as e:
            self.err(e, "Can not find table " + table)
        if self.db is None:
            msg = "Please connect a database before or provide a database url"
            self.err(msg)
            return
        recs = self.to_records_()
        for rec in recs:
            table.insert_ignore(rec, pks, ensure=True)
        self.ok("Data updated in table", table)