SQLite Forum

sqlite opens a database file in R/W mode, even if the file is read-only
Login
I prefer the 3.34 behaviour but doesn't this break backward compatibility?

With the readonly attribute set on Windows:

```
SQLite version 3.33.0 2020-08-14 13:23:32
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open ./db/test2.db
Error: unable to open database "./db/test2.db": unable to open database file
sqlite>
```

```
SQLite version 3.34.0 2020-12-01 16:14:00
Enter ".help" for usage hints.
sqlite> .open ./db/test2.db
sqlite> .databases
main: D:\SQLite32\db\test2.db r/o
sqlite>
```

 [f. The .databases dot-command now shows the status of each database file as determined by sqlite3_db_readonly() and sqlite3_txn_state().](https://sqlite.org/releaselog/3_34_0.html) does not make this change in behaviour explicit, that is, <i>that database error handling is now obsolete when the database exists.</i>