[sqlite] Read-only Attached DBs

2015-06-22 Thread R.Smith
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 w

[sqlite] What's the best way to pass function information to virtual table?

2015-06-22 Thread Jerry
Hi, MikeN. Assuming I want to compute the average value of all keys, how to write the query for this using match? For example, if I write SQL in this way > SELECT avg(key) From table WHERE key MATCH('avg'); with MATCH info, the virtual table is able to know the query is looking for average valu

[sqlite] Read-only Attached DBs

2015-06-22 Thread Richard Hipp
On 6/22/15, R.Smith 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 o

[sqlite] Double scan of table in WITH clause?

2015-06-22 Thread Mark Lawrence
Given the following example table and data: create table x(id integer); with recursive src(id) as (select 1 union all select id + 1 from src where id < 5) insert into x(id) selec