SQLite Forum

Do not auto reset after schema change
Login
Each run of a prepared statement is completely contained within a read
transaction.  So, in other words, the prepared statement sees the database
for a single snapshot in time. That means that from the point of view of
the prepared statement, the schema cannot change while
the prepared statement is running.

In WAL mode, other connections can indeed change the schema while the original
prepared statement is running.  But those schema changes are done in a separate
transaction.  The original read transaction used by the prepared statement
is unaffected by that schema change.  The original prepared statement continues
to see the schema as it existed prior to the changes in other transactions.