def sqlite3_exec_1(db, query, *args):
    """Execute a query returning a 1x1 table, and return its one value.

    Do not call this if you cannot guarantee the result is a 1x1
    table.  Beware passing user-controlled input in here.
    """
    cursor = db.cursor().execute(query, *args)
    row = cursor.fetchone()
    assert row
    assert len(row) == 1
    assert cursor.fetchone() == None
    return row[0]