Re: [sqlite] Basic SQLite/EF6 question

2014-07-04 Thread Joe Mistachkin
William Drago wrote: > > "Your project references the latest version of Entity > Framework; however, an Entity Framework database provider > compatible with this version could not be found for your > data connection." > In my end-to-end testing of the System.Data.SQLite 1.0.93.0 / Entity

Re: [sqlite] Basic SQLite/EF6 question

2014-07-04 Thread William Drago
Thank you for the reply. I'm getting further, but still have an issue when trying to add an Entity Data Model. The error message is: "Your project references the latest version of Entity Framework; however, an Entity Framework database provider compatible with this version could not be found

Re: [sqlite] Basic SQLite/EF6 question

2014-07-04 Thread Joe Mistachkin
William Drago wrote: > > I found this on Stack Overflow and it's pretty scary. Do I > really have to do all this to get SQLite/EF6 to work? > http://stackoverflow.com/questions/21757843/system-data-sqlite-1-0-91-0-and- ef6-0-2 > As of version 1.0.93.0 (and probably 1.0.92.0), those steps

[sqlite] Basic SQLite/EF6 question

2014-07-04 Thread William Drago
All, I am trying to use EF6.1.1 and SQLite 1.0.93.0 (3.8.5) in VS 2013. I've never used EF6 before, but I have been using System.Data.SQLite the normal way for about a year. now with excellent results. My question is, when I try to add a new ADO.NET Entity Data Model the only connection

Re: [sqlite] Building for vxWorks

2014-07-04 Thread James K. Lowden
On Fri, 4 Jul 2014 09:52:00 + Andy Ling wrote: > #if OS_VXWORKS && USING_DOSFS > if ( errno == S_dosFsLib_FILE_NOT_FOUND ) > #else > if( errno==ENOENT ) > #endif If I might suggest, unless ENOENT is defined: #if OS_VXWORKS && USING_DOSFS # define ENOENT

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Tim Streater
On 04 Jul 2014 at 15:35, Simon Slavin wrote: > On 4 Jul 2014, at 12:28pm, Tim Streater wrote: > >> On 04 Jul 2014 at 11:43, Simon Slavin wrote: >> >>> On 3 Jul 2014, at 10:22pm, Martin Kleusberg wrote:

Re: [sqlite] think I need better error-handling guidance in the C API

2014-07-04 Thread James K. Lowden
On Thu, 03 Jul 2014 19:00:21 +0200 RSmith wrote: > > A vague citation to a million anonymous programs of unknown quality > > is not a convincing reason to think otherwise. And you and I both > > know that a random sample of 1 million programs will contain > > roughly 999000

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Kees Nuyt
On Thu, 03 Jul 2014 23:22:46 +0200, Martin Kleusberg wrote: > I've encountered some odd behaviour when using the sqlite3_column_name > function. Here's my attempt to build a minimal example. > > Part 1: The database. Note that the table is not a 'without rowid' table and

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Simon Slavin
On 4 Jul 2014, at 12:28pm, Tim Streater wrote: > On 04 Jul 2014 at 11:43, Simon Slavin wrote: > >> On 3 Jul 2014, at 10:22pm, Martin Kleusberg wrote: >> >>> I've encountered some odd behaviour when using the

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread RSmith
On 2014/07/03 23:22, Martin Kleusberg wrote: Hi everybody, I've encountered some odd behaviour when using the sqlite3_column_name function. Here's my attempt to build a minimal example. Part 1: The database. Note that the table is not a 'without rowid' table and has a primary key: The

Re: [sqlite] Error xBestIndex returned an invalid plan

2014-07-04 Thread Dominique Devienne
On Fri, Jul 4, 2014 at 2:50 PM, Hick Gunter wrote: > "SELECT * FROM person WHERE name = 'fred';" will have SQLite asking "what is > the cost of a partial table scan on field name" ( {name, '='} ) and the > answer should be the average number of entries that must be read to

Re: [sqlite] Performace problem with SELECT after normalization

2014-07-04 Thread Erik Jensen
Hello Clemens, Friday, July 4, 2014, 1:43:47 PM, you wrote: CL> Erik Jensen wrote: >> > If the list of categories does not change, you could assign the >> > category IDs so that they have the same order as the names. >> >> Yes, that was my idea too if there is no other easy solution. >> >> Is

Re: [sqlite] Error xBestIndex returned an invalid plan

2014-07-04 Thread Hick Gunter
In the case outlined it is easy. If idxNum == 0 then there are no arguments. If idxNum == -1 then the only argument is the ID value of the single row to be retrieved. Lets assume you are implementing a virtual table person (name text, age int, ...) that stores the rows in a flat file (the

Re: [sqlite] Unicode support in SQLite

2014-07-04 Thread Aleksey Tulinov
Hello, I'm glad to announce that nunicode SQLite extension was updated to support Unicode 7.0.0 character set. It also implements LIKE operation which is faster compared to previous releases. This extension provides the following Unicode-aware components: - upper(X) - lower(X) - X LIKE Y

Re: [sqlite] Error xBestIndex returned an invalid plan

2014-07-04 Thread Micka
thx but how do you know in your vt_filter function : int vt_filter( sqlite3_vtab_cursor *cur, int idxNum, const char *idxStr, int argc, sqlite3_value **argv ){ that argv[0] is column index 4 by example ? Micka, On Fri, Jul 4, 2014 at 12:17 PM, Hick Gunter wrote: > AFAIKT

Re: [sqlite] Performace problem with SELECT after normalization

2014-07-04 Thread Clemens Ladisch
Erik Jensen wrote: > > If the list of categories does not change, you could assign the > > category IDs so that they have the same order as the names. > > Yes, that was my idea too if there is no other easy solution. > > Is there an easy/elegant way to re-order the "category" table and > update

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Hick Gunter
Of course it does. The good news is that SQLite tends to stick with whatever it comes up with first unless there is a significant change to the query. -Ursprüngliche Nachricht- Von: Tim Streater [mailto:t...@clothears.org.uk] Gesendet: Freitag, 04. Juli 2014 13:28 An: General Discussion

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Tim Streater
On 04 Jul 2014 at 11:43, Simon Slavin wrote: > On 3 Jul 2014, at 10:22pm, Martin Kleusberg wrote: > >> I've encountered some odd behaviour when using the sqlite3_column_name >> function. > > Sorry, but column names are guaranteed only if you use an

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Simon Slavin
On 3 Jul 2014, at 10:22pm, Martin Kleusberg wrote: > I've encountered some odd behaviour when using the sqlite3_column_name > function. Sorry, but column names are guaranteed only if you use an 'AS' clause in your SELECT command. For every other situation, there's no

[sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Martin Kleusberg
Hi everybody, I've encountered some odd behaviour when using the sqlite3_column_name function. Here's my attempt to build a minimal example. Part 1: The database. Note that the table is not a 'without rowid' table and has a primary key: $ sqlite3 test.db create table test(id integer primary

Re: [sqlite] Error xBestIndex returned an invalid plan

2014-07-04 Thread Hick Gunter
AFAIKT you currently have two supported operation modes: a) full table scan b) access via exact ID To implement a) you should make p_info->estimatedCost be the number of rows in your table (I suggest leaving p_info->idxNum as 0). To implement b) you need to check for a constraint with

Re: [sqlite] Error xBestIndex returned an invalid plan

2014-07-04 Thread Micka
Hi, Thx for this constructive message ;) I don't have a lot of experience with the this part of Sqlite which is very powerful ! In the xbestIndex function i'm using only this line : p_info->idxNum=p_info->aConstraint[0].iColumn; Because in my xfilter function I needed to know the index of

Re: [sqlite] Building for vxWorks

2014-07-04 Thread Andy Ling
> -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Andy Ling > Sent: 27 June 2014 10:27 > To: 'sqlite-users@sqlite.org' > Subject: [sqlite] Building for vxWorks > I now have sqlite running under vxWorks. As nobody offered

Re: [sqlite] Performace problem with SELECT after normalization

2014-07-04 Thread Simon Slavin
On 4 Jul 2014, at 8:06am, Erik Jensen wrote: > So i split it up into two tables: > > CREATE TABLE categories ( > id INTEGER NOT NULL PRIMARY KEY, > name TEXT NOT NULL DEFAULT '' > ); > CREATE INDEX category_index1 ON categories (name); > > CREATE TABLE products ( > id

Re: [sqlite] Error xBestIndex returned an invalid plan

2014-07-04 Thread Hick Gunter
As you noticed, you were asking to have the values of unusable constraints passed to your vt_filter function. But how are you telling your vt_filter function which fields the passed values belong to? I don't see how the column number of the first constraint - usable or not- is going to be

Re: [sqlite] Performace problem with SELECT after normalization

2014-07-04 Thread Erik Jensen
Hello Clemens, thanks for your response. >> But in 1.4m entries, the "category" field only had around 7000 >> different entries, this was a big waste of space. >> >> So i split it up into two tables: >> >> CREATE TABLE categories ( >> id INTEGER NOT NULL PRIMARY KEY, >> name TEXT NOT NULL

Re: [sqlite] Error xBestIndex returned an invalid plan

2014-07-04 Thread Clemens Ladisch
Micka wrote: > int vt_best_index(sqlite3_vtab *p_svt, sqlite3_index_info *p_info){ > sVTAB* p_vt = (sVTAB*)p_svt; > int i; > int j=1; > printf("vt_best_index %d\n", p_info->nConstraint); > > p_info->idxNum=0; > > if(p_info->nConstraint!=0){ > p_info->idxNum=p_info->aConstraint[0].iColumn;

Re: [sqlite] Error xBestIndex returned an invalid plan

2014-07-04 Thread Micka
Ok I looked at the source sqlite3.c and saw that : This is my correction : int vt_best_index(sqlite3_vtab *p_svt, sqlite3_index_info *p_info){ sVTAB* p_vt = (sVTAB*)p_svt; int i; int j=1; printf("vt_best_index %d\n", p_info->nConstraint); p_info->idxNum=0;

Re: [sqlite] Error xBestIndex returned an invalid plan

2014-07-04 Thread Micka
I've no word for this ! . On Fri, Jul 4, 2014 at 9:46 AM, Keith Medcalf wrote: > > The spacing and indentation are atrocious? > > >-Original Message- > >From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > >boun...@sqlite.org] On Behalf Of Micka >

Re: [sqlite] Error xBestIndex returned an invalid plan

2014-07-04 Thread Keith Medcalf
The spacing and indentation are atrocious? >-Original Message- >From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >boun...@sqlite.org] On Behalf Of Micka >Sent: Friday, 4 July, 2014 01:29 >To: General Discussion of SQLite Database >Subject: [sqlite] Error xBestIndex returned an

Re: [sqlite] Performace problem with SELECT after normalization

2014-07-04 Thread Keith Medcalf
What does EXPLAIN QUERY PLAN say about your query? Run ANALYZE What does EXPLAIN QUERY PLAN say about your query now? product_index1 is just a waste of space, by the way. >So i split it up into two tables: > >CREATE TABLE categories ( > id INTEGER NOT NULL PRIMARY KEY, > name TEXT NOT NULL

[sqlite] Error xBestIndex returned an invalid plan

2014-07-04 Thread Micka
Hi, I wanted to know what could be wrong with : int vt_best_index(sqlite3_vtab *p_svt, sqlite3_index_info *p_info){ sVTAB* p_vt = (sVTAB*)p_svt; int i; printf("vt_best_index %d\n", p_info->nConstraint); p_info->idxNum=0; if(p_info->nConstraint!=0){

Re: [sqlite] Performace problem with SELECT after normalization

2014-07-04 Thread Clemens Ladisch
Erik Jensen wrote: > First i had a single flat table, that looked like this: > > CREATE TABLE products ( > id INTEGER NOT NULL PRIMARY KEY, > category TEXT NOT NULL DEFAULT '', > weight INTEGER NOT NULL DEFAULT 0 > ); > CREATE INDEX product_index1 ON products (category); > CREATE INDEX

[sqlite] Performace problem with SELECT after normalization

2014-07-04 Thread Erik Jensen
Hello. I'm pretty much an SQL newbie, so please bear with me. I have a performance problem after normalizing a table. First i had a single flat table, that looked like this: CREATE TABLE products ( id INTEGER NOT NULL PRIMARY KEY, category TEXT NOT NULL DEFAULT '', weight INTEGER NOT