'Given a cursor object that has just performed an INSERT...RETURNING
statement into a table that has an auto-incrementing ID, return the
newly created ID.'

def fetch_returned_insert_id(self, cursor):

    return cursor.fetchone()[0]
