SQLite Forum

sqlite3_stmt_readonly is dependent on the current database
Login
But how would that work in the example given, in as much as the re-prepare
changes the classification.

A "CREATE TABLE IF NOT EXISTS" statement is read-only if the table already
exists.  But it is read/write if the table does not exist.

Do we create a new return code from sqlite3_stmt_readonly() that means
"Maybe - it depends on what has changed in the schema since the statement
was last run?"

I looked into modifying sqlite3_stmt_readonly() so that it always returns
FALSE for CREATE TABLE statements, even if the statement will be a no-op.
I could still do that, but I'm worried that the change in behavior might
break legacy applications.