On 6/22/15, R.Smith <rsmith at rsweb.co.za> wrote: > I simply have a database with some number of tables which, depending on > the client, may or may not be opened in read-only mode. > > To this connection I attach another smaller DB which simply have things > posted to it on occasion as needed. > > When the main DB is opened in read-only mode and I try to write to a > table in the Attached DB, this obviously fails and reports the read-only > notice. How can I attach some DB to a read-only DB so that the attached > DB is not read-only? > > (I could open the other DB and then attach the main one, but that would > render the main one NOT read-only, so not viable). > > In fact, is there any way in which one could see one DB from another > without having the same read-only-ness imposed on both? >
URI filenames with "mode=ro" or "mode=rw" query parameters. https://www.sqlite.org/c3ref/open.html#urifilenamesinsqlite3open -- D. Richard Hipp drh at sqlite.org