Re: [sqlite] SQLite 3.8.8 expected in January

2015-01-11 Thread RSmith
On 2015/01/10 15:50, Richard Hipp wrote: Yes, it was a compile-time omission. I have uploaded a new DLL that includes the loadable extension interface. Thank you - it works perfectly for all entries. All other tests worked well too, so no new problems to report from this side.

Re: [sqlite] SQLite Android Bindings: how difficult to add LOCALIZED back?

2015-01-11 Thread Philip Warner
On 9/01/2015 5:00 PM, Dan Kennedy wrote: On 01/08/2015 07:48 AM, Philip Warner wrote: How difficult would it be to add LOCALIZED collation support? I'm guessing that the fact it's not there means it's non-trivial, but I was hoping otherwise... The stumbling block is that the Android

Re: [sqlite] aggregate functions with DISTINCT

2015-01-11 Thread Clemens Ladisch
Staffan Tylen wrote: Well, the SELECT is actually over 400 lines long [...] I can't use SELECT DISTINCT X as that wouldn't give the result I want, and I can't use SELECT DISTINCT 'ABC' either. So my Yes, it might work comment doesn't actually hold. I see no other way than to use DISTINCT with

Re: [sqlite] PK References One of Two Other Tables

2015-01-11 Thread Rich Shepard
On Sun, 11 Jan 2015, Simon Slavin wrote: You can't do the latter. Foreign keys can reference only one table. You could create yet another table, which just supplies primary keys, but it would seem that this would just duplicate a function of your 'items' table. Simon, That's what I

[sqlite] xBestIndex/XFilter and virtual tables

2015-01-11 Thread Venkat Murty
Hi, I have a virtual table. create table store (id int, stamp int, value blob); When i execute the following sql select stamp, to_text(value) from store where id = 42; I get as expected sqlite3_index_info to have one usable entry with aConstraint[i].iColumn = 0 aConstraint[i].op

[sqlite] PK References One of Two Other Tables

2015-01-11 Thread Rich Shepard
Items to be raffled can be donated or purchased. The Donations and Purchases tables each have the item ID as their PK. The Raffles table should have the PK as either the Donations or the Purchases item ID. How do I write the DDL creating the Raffles table so that the PK is either a donated

Re: [sqlite] PK References One of Two Other Tables

2015-01-11 Thread Simon Slavin
On 11 Jan 2015, at 6:21pm, Rich Shepard rshep...@appl-ecosys.com wrote: I've only had a foreign key reference one specific table, not either of two tables You can't do the latter. Foreign keys can reference only one table. You could create yet another table, which just supplies primary

Re: [sqlite] PK References One of Two Other Tables

2015-01-11 Thread John McKown
On Sun, Jan 11, 2015 at 12:21 PM, Rich Shepard rshep...@appl-ecosys.com wrote: Items to be raffled can be donated or purchased. The Donations and Purchases tables each have the item ID as their PK. The Raffles table should have the PK as either the Donations or the Purchases item ID. How

Re: [sqlite] PK References One of Two Other Tables

2015-01-11 Thread Keith Medcalf
On Sunday, 11 January, 2015 11:22, Rich Shepard rshep...@appl-ecosys.com said: Items to be raffled can be donated or purchased. The Donations and Purchases tables each have the item ID as their PK. The Raffles table should have the PK as either the Donations or the Purchases item ID. How

Re: [sqlite] xBestIndex/XFilter and virtual tables

2015-01-11 Thread Richard Hipp
On 1/11/15, Venkat Murty vmu...@fiberlink.com wrote: Hi, I have a virtual table. create table store (id int, stamp int, value blob); When i execute the following sql select stamp, to_text(value) from store where id = 42; I get as expected sqlite3_index_info to have one usable entry

Re: [sqlite] SQLite Android Bindings: how difficult to add LOCALIZED back?

2015-01-11 Thread Christian Werner
On 01/11/2015 01:55 PM, Philip Warner wrote: On 9/01/2015 5:00 PM, Dan Kennedy wrote: On 01/08/2015 07:48 AM, Philip Warner wrote: How difficult would it be to add LOCALIZED collation support? I'm guessing that the fact it's not there means it's non-trivial, but I was hoping otherwise...

Re: [sqlite] xBestIndex/XFilter and virtual tables

2015-01-11 Thread Venkat Murty
I am expecting two usable entries in sqlite3_index_info with aConstraint[i].iColumn = 0 and aConstraint[i].op == SQLITE_INDEX_CONSTRAINT_EQ for each check What actually happens is that SQLite transforms the query into SELECT stamp, to_text(value) FROM store WHERE id IN (42,24). The

Re: [sqlite] xBestIndex/XFilter and virtual tables

2015-01-11 Thread Richard Hipp
On 1/11/15, Venkat Murty vmu...@fiberlink.com wrote: I am expecting two usable entries in sqlite3_index_info with aConstraint[i].iColumn = 0 and aConstraint[i].op == SQLITE_INDEX_CONSTRAINT_EQ for each check What actually happens is that SQLite transforms the query into SELECT stamp,

Re: [sqlite] xBestIndex/XFilter and virtual tables

2015-01-11 Thread Venkat Murty
Estimated cost and row for each call to xBestIndex (sqlite3_index_info is filled with the below values for each call) a) When there is one non-usable constraint idxNum = 0 estimatedCost = 1000.00 estimatedRows = 1000 b) when there is one usable constraint idxNum = 1 estimatedCost

Re: [sqlite] xBestIndex/XFilter and virtual tables

2015-01-11 Thread Hick Gunter
SQLite is asking your virtual table questions: 1) what is the cost of a full table scan? (your answer: 1000) 2) what is the cost of a lookup by id? (your answer: 1) 3) when performing a key lookup, do you promise to return only rows matching the key? (your answer in returned in the omit field)

Re: [sqlite] xBestIndex/XFilter and virtual tables

2015-01-11 Thread Hick Gunter
BTW: SQLite will also ask your virtual table about GROUP BY/ORDER BY capabilities if either of the clauses is included in the SELECT. -Ursprüngliche Nachricht- Von: Hick Gunter [mailto:h...@scigames.at] Gesendet: Montag, 12. Jänner 2015 08:02 An: 'General Discussion of SQLite Database'