On Mon, Apr 25, 2016 at 2:33 PM, Mark Foley <mfoley at novatec-inc.com> wrote:

> I'm new to the list, so apologies if this has been posted before.
>
> I am using sqlite3 3.7.17 on Linux Slackware64 14.1. I use the sqlite3
> command
> every 10 minutes to query several Thunderbird calendar databases.
> Occasionally, I
> have a message, "Error: database is locked"; understandable since
> Thunderbird
> is occasionally updating its database.
>
> First, is there a way to open a database in readonly mode from the command
> line?
> I 've searched the man page and googled, but I find nothing. I've tried
> opening
> the database as dbname?mode=ro, but that doesn't work. The C API has such a
> mode, but apparently not the command line.
>

Perhaps you're missing the leading file: ? I believe it is required. --DD

C:\Users\DDevienne>sqlite3 new.db
SQLite version 3.10.2 2016-01-20 15:27:19
Enter ".help" for usage hints.
sqlite> create table t (v);
sqlite> insert into t values (1), (2), (3);
sqlite> .q

C:\Users\DDevienne>sqlite3 file:new.db?mode=ro
SQLite version 3.10.2 2016-01-20 15:27:19
Enter ".help" for usage hints.
sqlite> select * from t;
1
2
3
sqlite> update t set v = 4;
Error: attempt to write a readonly database
sqlite>

Reply via email to