SQLite Forum

C api sqlite3_db_readonly returns -1
Login
(Clarifying for the OP:) A very short repro sequence, with the exact code used to open the database followed by the exact code which returns -1, with symbolic constants of your own devise replaced by literals, will suffice.

Without speculating, because I have read the relevant code, I can say that a -1 return instead of a C boolean (1 or 0) return indicates an invalid call of one form or another.  As to how your call is invalid, I could only speculate before seeing your code.