def touch(self, connection=None):
        """
        Mark this update as complete.

        Important: If the marker table doesn't exist, the connection transaction will be aborted
        and the connection reset.
        Then the marker table will be created.
        """
        self.create_marker_table()

        if connection is None:
            # TODO: test this
            connection = self.connect()
            connection.autocommit = True  # if connection created here, we commit it here

        if self.use_db_timestamps:
            connection.cursor().execute(
                """INSERT INTO {marker_table} (update_id, target_table)
                   VALUES (%s, %s)
                """.format(marker_table=self.marker_table),
                (self.update_id, self.table))
        else:
            connection.cursor().execute(
                """INSERT INTO {marker_table} (update_id, target_table, inserted)
                         VALUES (%s, %s, %s);
                    """.format(marker_table=self.marker_table),
                (self.update_id, self.table,
                 datetime.datetime.now()))
def touch ( self , connection = None ) : self . create_marker_table ( ) if connection is None : connection = self . connect ( ) connection . autocommit = True if self . use_db_timestamps : connection . cursor ( ) . execute ( """INSERT INTO {marker_table} (update_id, target_table)
                   VALUES (%s, %s)
                """ . format ( marker_table = self . marker_table ) , ( self . update_id , self . table ) ) else : connection . cursor ( ) . execute ( """INSERT INTO {marker_table} (update_id, target_table, inserted)
                         VALUES (%s, %s, %s);
                    """ . format ( marker_table = self . marker_table ) , ( self . update_id , self . table , datetime . datetime . now ( ) ) )
Mark this update as complete.

        Important: If the marker table doesn't exist, the connection transaction will be aborted
        and the connection reset.
        Then the marker table will be created.