On Mon, 25 Apr 2016 14:41:30 Dominique Devienne <ddevienne at gmail.com> wrote:

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

No, unless I'm putting it in the wrong place. As I wrote I did:

$ sqlite3 "myDbpath?mode=ro"

I also tried escaping the '?' as '\?', no go. 

Should this work from the command line? Should the '?' go somewhere else? Can
you give a working commandline example?

THX --Mark

-----Original Message-----
> Date: Mon, 25 Apr 2016 14:41:30 +0200
> From: Dominique Devienne <ddevienne at gmail.com>
> To: SQLite mailing list <sqlite-users at mailinglists.sqlite.org>
> Subject: Re: [sqlite] sqlite3 command line, read-only
>
> 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>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

Reply via email to