I'd like to open an sqlite3 database, and immediately check that it is not opened read-only. Since I know I'll need to write to it, I want to return an error immediately at start-up, and not have to wait until a later time when the program first tries to do a write.
I see there is a sqlite3 C API function sqlite3_db_readonly()
. Is it possible to access this function from the Python API? Or is there some other way to check if a database is read-only from the Python API?