'Execute an SQL statement with substitution values and return
the row ID of the last affected row.'

def mutate(self, statement, subvals=()):

    try:
        cursor = self.db._connection().execute(statement, subvals)
        return cursor.lastrowid
    except sqlite3.OperationalError as e:
        if (e.args[0] in ('attempt    to    write    a    readonly    database', 'unable    to    open    database    file')):
            raise DBAccessError(e.args[0])
        else:
            raise
