Re: [sqlite] Data visibility problem

2014-06-22 Thread Igor Tandetnik
On 6/22/2014 6:33 PM, João Ramos wrote: What happens is this: - a thread acquires the write DB connection - that thread inserts a new row in a table and gets its id - the thread releases the write DB connection (so that other threads can use it) - the same thread acquires (its own) read-only DB

[sqlite] Data visibility problem

2014-06-22 Thread João Ramos
Hi, The issue appeared with the following scenario: - using SQLite v3.8.4.3 - the DB is in WAL mode and running with multi-thread mode - every thread has a read-only DB connection (using thread-local-storage) - a single DB connection is shared between threads to write - this write DB

Re: [sqlite] sqlite.net (a.k.a. System.Data.SQLite) support

2014-06-22 Thread Sean McBride
You are using the straight SQLite classes to execute commands and such. Why not use EF6 and use SQLite as a data source. All the visual studio stuff works with it just the same a SQL server. If you can use .Net 4.0 or 4.5 then that is the way to go. You can use the EF 6 entity diagrams to

Re: [sqlite] Question about opening database files

2014-06-22 Thread Richard Hipp
On Sun, Jun 22, 2014 at 10:47 AM, Adil Hasan wrote: > Hello, > I would like to add sqlite to a workflow. But, I cannot directly open the > database in C using the filename as the application I'm using places a > layer > inbetween the filesystem and my workflow. I can open

Re: [sqlite] Planner chooses incorrect index

2014-06-22 Thread Richard Hipp
On Sun, Jun 22, 2014 at 2:05 PM, João Ramos wrote: > > Everything looks fine and the query runs smoothly, but at around 15000 > entries, the query plan changes... > Please send the content of the sqlite_stat1 table. Also sqlite_stat3 or sqlite_stat4, if they exist. Do

[sqlite] sqlite.net (a.k.a. System.Data.SQLite) support

2014-06-22 Thread Baruch Burstein
This is not technically sqlite specific, rather .net in general, but it came up using sqlite.net, so I am asking here. If someone can point me to a general answer elsewhere, that would be great, too. I downloaded and "installed" (read: copied) the files to my project. I can create connections,

[sqlite] Planner chooses incorrect index

2014-06-22 Thread João Ramos
Hi, I'm using SQLite v3.8.4.3 and the issue happens in a table with the following schema: CREATE TABLE HistoryEntry ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, sourceType INTEGER NOT NULL, sourceId INTEGER, uri TEXT NOT NULL, historyOrder BIGINT NOT NULL CHECK (historyOrder >= 0) DEFAULT

Re: [sqlite] Question about opening database files

2014-06-22 Thread Adil Hasan
Hello Mike, thanks for the very quick response. That's very interesting. It looks (maybe I am wrong) as if you open a sqlite database file and then in your program you open a stream and use socat to connect the two together? I'm not sure if I can use such an approach in my situation. In my

Re: [sqlite] Question about opening database files

2014-06-22 Thread mikeegg1
I’m working on accessing sqlite3 from a process/program that is not able to access sqlite3.a by using sockets through socat(1). Mike On Jun 22, 2014, at 9:47 AM, Adil Hasan wrote: > Hello, > I would like to add sqlite to a workflow. But, I cannot directly open the >

[sqlite] Question about opening database files

2014-06-22 Thread Adil Hasan
Hello, I would like to add sqlite to a workflow. But, I cannot directly open the database in C using the filename as the application I'm using places a layer inbetween the filesystem and my workflow. I can open the file with a command from the middle-layer and get a file descriptor. Is there a way

Re: [sqlite] CAST vs. ROUND in ORDER BY

2014-06-22 Thread Tim Streater
On 22 Jun 2014 at 10:08, Clemens Ladisch wrote: > Tim Streater wrote: >> I have a text column containing floating point strings like 23.6, 8.4, >> 0.3, etc. These always have just the one digit after the decimal point. >> >> ... ORDER BY ROUND (myfield, 1); >> >> but now I

Re: [sqlite] Performance issue using SQLite

2014-06-22 Thread lyx
Sorry, the first sql statement in my previous mail is incorrect. It is not " sprintf (sql_str, "select ctrl_no from T_CTRL_CLRRULE where CTRL_NO='%s' and ((PRODUCT_ID='%s' and OPERATE_TYPE='%s') or (PRODUCT_ID='AA' and OPERATE_TYPE='%s') or (PRODUCT_ID='%s' and OPERATE_TYPE='AA')) and

Re: [sqlite] CAST vs. ROUND in ORDER BY

2014-06-22 Thread Clemens Ladisch
Tim Streater wrote: > I have a text column containing floating point strings like 23.6, 8.4, > 0.3, etc. These always have just the one digit after the decimal point. > > ... ORDER BY ROUND (myfield, 1); > > but now I see I could just as well do: > > ... ORDER BY CAST (myfield AS REAL); > > Is

[sqlite] CAST vs. ROUND in ORDER BY

2014-06-22 Thread Tim Streater
I have a text column containing floating point strings like 23.6, 8.4, 0.3, etc. These always have just the one digit after the decimal point. This column was sometimes being used in an ORDER BY and then I realised that it wasn't going to sort properly. The use of a TEXT field was deliberate in