V 3.34.0
(1) By anonymous on 2020-12-02 11:12:56 [link] [source]
Using Windows 10; just downloaded v 3.34.0 & checked the release notes for changes.
Issue 1
Session screen - 3.34.0
SQLite version 3.34.0 2020-12-01 16:14:00
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open ./db/pubs.db
sqlite> .databases
main: D:\SQLite32\db\pubs.db r/w
sqlite>
Session screen - 3.33.0
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/pubs.db
sqlite> .databases
main: F:\SQLite32\db\pubs.db
sqlite>
Note r/w (I assume read/write) in the 3.34 session: Can't see this change in the release notes. Is it possible to open databases in read only mode. now?
(2) By Richard Hipp (drh) on 2020-12-02 17:36:48 in reply to 1 [link] [source]
Can't see this change in the release notes.
Item 4f in the change log.
Is it possible to open databases in read only mode. now?
Has been for a long time. Use ".help open" for details. You want the --readonly option, I think.
(3) By anonymous on 2020-12-02 18:00:38 in reply to 2 [link] [source]
Thank you.
My session:
SQLite version 3.34.0 2020-12-01 16:14:00
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open ./db/pubs.db --readonly
sqlite> .databases
main: D:\SQLite32\db\pubs.db r/w
sqlite>
I'm still seeing r/w (expecting r).
(4) By anonymous on 2020-12-02 18:08:04 in reply to 3 [source]
My mistake; apologies.
SQLite version 3.34.0 2020-12-01 16:14:00
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open --readonly ./db/pubs.db
sqlite> .databases
main: D:\SQLite32\db\pubs.db r/o
sqlite>
(5) By RandomCoder on 2020-12-02 18:10:42 in reply to 3 [link] [source]
The options need to come before the file:
SQLite version 3.34.0 2020-12-01 16:14:00
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .open dbname.db --readonly
sqlite> .databases
main: c:\test\dbname.db r/w
sqlite> .open --readonly dbname.db
sqlite> .databases
main: c:\test\dbname.db r/o
(6) By Keith Medcalf (kmedcalf) on 2020-12-02 18:12:00 in reply to 3 [link] [source]
I would suggest that you read the documentation and follow it. Your command is bassackwards.
>sqlite
-- Loading resources from C:\Users\KMedcalf/.sqliterc
SQLite version 3.35.0 2020-12-02 03:04:06
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> .help open
.open ?OPTIONS? ?FILE? Close existing database and reopen FILE
Options:
--append Use appendvfs to append database to the end of FILE
--deserialize Load into memory useing sqlite3_deserialize()
--hexdb Load the output of "dbtotxt" as an in-memory db
--maxsize N Maximum size for --hexdb or --deserialized database
--new Initialize FILE to an empty database
--nofollow Do not follow symbolic links
--readonly Open FILE readonly
--zip FILE is a ZIP archive
sqlite> .open --readonly cases.db
sqlite> .databases
main: D:\work\covid\cases.db r/o
sqlite>