But because the SELECT statement does not change the database file
directly, sqlite3_stmt_readonly() would still return true.

Transaction control statements such as BEGIN, COMMIT, ROLLBACK,
SAVEPOINT, and RELEASE cause sqlite3_stmt_readonly() to return true,
since the statements themselves do not actually modify the database but
rather they control the timing of when other statements modify the
database. The ATTACH and DETACH statements also cause
sqlite3_stmt_readonly() to return true since, while those statements
change the configuration of a database connection, they do not make
changes to the content of the database files on disk.