[sqlite] Using the same database from four separate applications

2011-06-12 Thread Ian Hardingham
Hey guys. I believe it's fine to have four applications open the same database file and use it concurrently. I have a few questions. 1. Do I need to use any special PRAGMA or other option to use this functionality best? 2. Is it possible to (ab)use SQLite to perform as some kind of mutex?

Re: [sqlite] Using the same database from four separate applications

2011-06-12 Thread Simon Slavin
On 12 Jun 2011, at 12:07pm, Ian Hardingham wrote: I believe it's fine to have four applications open the same database file and use it concurrently. Assuming you are compiling without any special directives which turn this ability off. For instance, read about everything mentioned in the

Re: [sqlite] Using the same database from four separate applications

2011-06-12 Thread Ian Hardingham
Hey Simon, thanks for this. I would really like to only block specifically one operation, rather than not allowing any database access in the exclusive block - is this possible? Thanks, Ian I'm not certain I understand your question but SQLite performs a kind of mutexing by default. If

[sqlite] Query help

2011-06-12 Thread Marco Bambini
Hello guys, I have a table Clients defined as (simplified version): CREATE TABLE Clients (id INTEGER PRIMARY KEY AUTOINCREMENT, last_activity TEXT, ping_timeout INTEGR); each time a client performs an operation the last_activity column is updated with: UPDATE Clients SET

[sqlite] Store result of calculation or not

2011-06-12 Thread Ian Hardingham
Guys, my apologies for spamming the list today. A topic I've talked about before, but am just revisiting. I often need to get the record between two people - how many games they've won and lost against each other. For reference, the query is at the end of the email. Once again,

Re: [sqlite] Query help

2011-06-12 Thread Roger Andersson
On 06/12/11 01:52 PM, Marco Bambini wrote: things are recently changed in my app and ping_timeout is now a client property set inside the Clients table (and no longer a global property), so I would like to perform the query: snprintf(sql, sizeof(sql), select id from Clients where

Re: [sqlite] Query help

2011-06-12 Thread Marco Bambini
No I am sorry but I need to query the ping_timeout column from inside the same query. -- Marco Bambini http://www.sqlabs.com On Jun 12, 2011, at 2:02 PM, Roger Andersson wrote: On 06/12/11 01:52 PM, Marco Bambini wrote: things are recently changed in my app and ping_timeout is now a

[sqlite] How to re-compile both DLLs with a specific framework

2011-06-12 Thread Cyrille
Dear all, Following Pavel's answers to my topic Cannot load SQLite.Interop.dll but file is in the folder (cf. below), it seems necessary for me to re-compile both DLLs (System.Data.SQLite.dll and SQLite.Interop.dll) with a specific framework version (my application uses the framework 3.0).

[sqlite] cross join very slow, which is better select virtually using cross join, or create physically data output from cross join?

2011-06-12 Thread iip
Hi All, I tried to create Cartesian list from 8 digit text that has 256 row. when I try below statement, the time to fetch the result was very long, I'm always press ctrl+c because its run more than 20 minute: select a.a,b.b,c.c,d.d, max(length(a.a||b.b||c.c||d.d)) as e from (select text8) as a

[sqlite] announce: new sqlite3 JavaScript binding

2011-06-12 Thread Stephan Beal
For that small handful of sqlite3+v8 hackers out there... http://code.google.com/p/v8-juice/wiki/JSPDO JSPDO is a PHP PDO-like db access abstraction API, but using JavaScript (via the Google v8 JS engine). It supports sqlite3 and MySQLv5. Happy Hacking! -- - stephan beal

Re: [sqlite] cross join very slow, which is better select virtually using cross join, or create physically data output from cross join?

2011-06-12 Thread Igor Tandetnik
iip iip.umar.ri...@gmail.com wrote: I tried to create Cartesian list from 8 digit text that has 256 row. when I try below statement, the time to fetch the result was very long, I'm always press ctrl+c because its run more than 20 minute: select a.a,b.b,c.c,d.d,

Re: [sqlite] Using the same database from four separate applications

2011-06-12 Thread Ian Hardingham
A further question to this. If process B tries to access a table which process A is currently writing to, is an error returned or does sqlite block? I very much need SQLite to block - is there an option for that? Thanks, Ian On 12/06/2011 12:23, Simon Slavin wrote: On 12 Jun 2011, at

Re: [sqlite] Using the same database from four separate applications

2011-06-12 Thread Simon Slavin
On 12 Jun 2011, at 3:05pm, Ian Hardingham wrote: If process B tries to access a table which process A is currently writing to, is an error returned or does sqlite block? I very much need SQLite to block - is there an option for that? [context: Ian is explicitly using BEGIN EXCLUSIVE for

Re: [sqlite] Using the same database from four separate applications

2011-06-12 Thread Ian Hardingham
Thanks again Simon, I am actually asking for queries that may well not be in an EXCLUSIVE section, but I've realised that I can simulate the blocking in my own application by busy-waiting. Ian On 12/06/2011 15:16, Simon Slavin wrote: On 12 Jun 2011, at 3:05pm, Ian Hardingham wrote: If

Re: [sqlite] cross join very slow, which is better select virtually using cross join, or create physically data output from cross join?

2011-06-12 Thread iip
On Sun, Jun 12, 2011 at 8:58 PM, Igor Tandetnik itandet...@mvps.org wrote: iip iip.umar.ri...@gmail.com wrote: I tried to create Cartesian list from 8 digit text that has 256 row. when I try below statement, the time to fetch the result was very long, I'm always press ctrl+c because its

Re: [sqlite] Store result of calculation or not

2011-06-12 Thread Igor Tandetnik
Ian Hardingham i...@omroth.com wrote: I often need to get the record between two people - how many games they've won and lost against each other. For reference, the query is at the end of the email. Once again, multiturnTable has a million rows, I have separate indexes on complete and

Re: [sqlite] Store result of calculation or not

2011-06-12 Thread Ian Hardingham
Many thanks Igor. Would this index be enough: CREATE INDEX IF NOT EXISTS mtTablePlayer1 ON multiturnTable (player1,player2) Or do I need the opposite as well? CREATE INDEX IF NOT EXISTS mtTablePlayer1 ON multiturnTable (player2,player1) Why I have two queries: the order of the arguments are

Re: [sqlite] Query help

2011-06-12 Thread Igor Tandetnik
Marco Bambini ma...@sqlabs.net wrote: I have a table Clients defined as (simplified version): CREATE TABLE Clients (id INTEGER PRIMARY KEY AUTOINCREMENT, last_activity TEXT, ping_timeout INTEGR); ping_timeout was a global property so in order to get a list of all clients timedout I used a

Re: [sqlite] Store result of calculation or not

2011-06-12 Thread Igor Tandetnik
Ian Hardingham i...@omroth.com wrote: Would this index be enough: CREATE INDEX IF NOT EXISTS mtTablePlayer1 ON multiturnTable (player1,player2) Or do I need the opposite as well? CREATE INDEX IF NOT EXISTS mtTablePlayer1 ON multiturnTable (player2,player1) For the queries you've

Re: [sqlite] Query help

2011-06-12 Thread Marco Bambini
Thanks a lot Igor, it's perfect now. -- Marco Bambini http://www.sqlabs.com On Jun 12, 2011, at 4:46 PM, Igor Tandetnik wrote: Marco Bambini ma...@sqlabs.net wrote: I have a table Clients defined as (simplified version): CREATE TABLE Clients (id INTEGER PRIMARY KEY AUTOINCREMENT,

Re: [sqlite] SQLite: MIPS, Linux Kernel space, In-memory. Is it possible?

2011-06-12 Thread Richard Hipp
On Sun, Jun 12, 2011 at 11:18 AM, Yan Nagler yan.nag...@broadlight.comwrote: Hello dear SQLite users! My name is Yan Nagler. I am from Israel and currently work for Broadlight Inc. We would like to adopt the SQLite for our needs. The main goal is probably as usual: having all the

Re: [sqlite] Store result of calculation or not

2011-06-12 Thread BareFeetWare
On 12/06/2011, at 9:59 PM, Ian Hardingham wrote: I often need to get the record between two people - how many games they've won and lost against each other. For reference, the query is SELECTcount(*) TotalGames , sum(score 0) GamesWonByPlayer1 , sum(score 0)

Re: [sqlite] Store result of calculation or not

2011-06-12 Thread Igor Tandetnik
BareFeetWare list@barefeetware.com wrote: On 12/06/2011, at 9:59 PM, Ian Hardingham wrote: Once again, multiturnTable has a million rows, I have separate indexes on complete and player1 and player2 (should I also add an index on player1, player2?) Yes. Since your query asks for