Re: [sqlite] plans for completion of INSERT OR REPLACE INTO?

2009-07-06 Thread James Gregurich
, 2009, at 3:53 AM, Simon Slavin wrote: (Sorry, hit 'Send' before I meant to.) On 6 Jul 2009, at 6:34am, James Gregurich wrote: a question for the sqlite developers. The inability of INSERT OR REPLACE to maintain referential integrity leaves me with no mechanism to implement a feature

Re: [sqlite] plans for completion of INSERT OR REPLACE INTO?

2009-07-06 Thread James Gregurich
On Jul 6, 2009, at 1:15 PM, Simon Slavin wrote: Please quote previous text above your response to it. We read English top to bottom. On 6 Jul 2009, at 8:22pm, James Gregurich wrote: On Jul 6, 2009, at 3:53 AM, Simon Slavin wrote: It should not call DELETE triggers since it never deletes

Re: [sqlite] referential integrity and INSERT OR REPLACE

2009-07-06 Thread James Gregurich
based on the test I just ran, it reports the first one encountered only. On Jul 6, 2009, at 2:53 PM, Nicolas Williams wrote: On Sat, Jul 04, 2009 at 10:24:50AM +0200, Kees Nuyt wrote: On Fri, 03 Jul 2009 14:38:43 -0700, James Gregurich bayouben...@mac.com wrote: nuts. that makes INSERT

Re: [sqlite] plans for completion of INSERT OR REPLACE INTO?

2009-07-06 Thread James Gregurich
On Jul 6, 2009, at 3:14 PM, Nicolas Williams wrote: On Mon, Jul 06, 2009 at 02:49:07PM -0700, James Gregurich wrote: 1) Why on earth would you want to scroll all the way to the bottom of a long email to get the response simply for the sake of We read English top to bottom. Any quoted

[sqlite] plans for completion of INSERT OR REPLACE INTO?

2009-07-05 Thread James Gregurich
a question for the sqlite developers. The inability of INSERT OR REPLACE to maintain referential integrity leaves me with no mechanism to implement a feature in my project that I was intending to provide. Are there any plans to add in the functionality for INSERT OR REPLACE to call delete

[sqlite] referential integrity and INSERT OR REPLACE

2009-07-03 Thread James Gregurich
question: How do I maintain referential integrity on a INSERT OR REPLACE given it does not call the delete trigger on the offending rows? thanks, james ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] referential integrity and INSERT OR REPLACE

2009-07-03 Thread James Gregurich
I read on another posting in the archives that it does not. However, I haven't tried it myself. -James Simon Slavin Fri, 03 Jul 2009 09:44:22 -0700 On 3 Jul 2009, at 3:28am, James Gregurich wrote: How do I maintain referential integrity on a INSERT OR REPLACE given it does not call

Re: [sqlite] referential integrity and INSERT OR REPLACE

2009-07-03 Thread James Gregurich
nuts. that makes INSERT OR REPLACE worthless if you have tables dependent on one another. Is there any way to manually get a list of records for which there would be a conflict if a given record was inserted? On Fri, 03 Jul 2009 11:29:14 -0700, James Gregurich bayouben...@mac.com wrote

Re: [sqlite] getting offending constraint

2009-07-02 Thread James Gregurich
) THEN RAISE(ABORT, 'no parent element') END; END; COMMIT; sqlite INSERT INTO test1b VALUES(1,10,20); SQL error: no parent element sqlite On Jul 1, 2009, at 6:40 PM, Simon Slavin wrote: On 2 Jul 2009, at 1:57am, James Gregurich wrote: I tried that, but I still got back constraint failed rather

[sqlite] getting offending constraint

2009-07-01 Thread James Gregurich
howdy! Would there be a way to identify the offending constraint if SQLITE_CONSTRAINT is returned? sqlite3_errmsg is just telling me constraint failed...which is of limited usefulness. -James ___ sqlite-users mailing list

Re: [sqlite] getting offending constraint

2009-07-01 Thread James Gregurich
How would I have hijacked a thread? I changed the subject and removed the original text. On Jul 1, 2009, at 12:32 PM, Roger Binns wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 James Gregurich wrote: howdy! You hijacked someone else's thread by hitting reply, rather than

Re: [sqlite] getting offending constraint

2009-07-01 Thread James Gregurich
ah. I have no knowledge of how mailing list programs work. no poor etiquette was intended. On Jul 1, 2009, at 1:41 PM, P Kishor wrote: On Wed, Jul 1, 2009 at 3:39 PM, James Gregurichbayouben...@mac.com wrote: How would I have hijacked a thread? I changed the subject and removed the

Re: [sqlite] getting offending constraint

2009-07-01 Thread James Gregurich
thanks. I tried that, but I still got back constraint failed rather than my RAISE message. Since you say it should work, I probably did something wrong. I'll look at it again. On Jul 1, 2009, at 3:59 PM, Simon Slavin wrote: On 1 Jul 2009, at 8:19pm, James Gregurich wrote: Would

Re: [sqlite] [noob] merge statement equivalent?

2009-06-19 Thread James Gregurich
thanks! On Jun 18, 2009, at 6:01 PM, Dennis Cote wrote: James Gregurich wrote: on that update statement, is the SQL optimizer smart enough to not rerun that select statement for each column in the update's set clause? Is it going to run a single select statement to get value1, value2, etc

Re: [sqlite] [noob] merge statement equivalent?

2009-06-17 Thread James Gregurich
Dennis, question on an old post of yours below... on that update statement, is the SQL optimizer smart enough to not rerun that select statement for each column in the update's set clause? Is it going to run a single select statement to get value1, value2, etc. or is it going to run one

Re: [sqlite] [noob] merge statement equivalent?

2009-06-17 Thread James Gregurich
So what are you going to do? we need to get your plans pinned down. On Jun 17, 2009, at 11:46 AM, James Gregurich wrote: Dennis, question on an old post of yours below... on that update statement, is the SQL optimizer smart enough to not rerun that select statement for each column

Re: [sqlite] [noob] merge statement equivalent?

2009-06-17 Thread James Gregurich
oops. sorry for errant message, folks. I had the wrong email selected when I hit the button and didn't pay attention to what I was doing. On Jun 17, 2009, at 3:19 PM, James Gregurich wrote: So what are you going to do? we need to get your plans pinned down. On Jun 17, 2009, at 11:46 AM

[sqlite] append table

2009-05-16 Thread James Gregurich
howdy! Questions: suppose tables t1 t2 exits in two separate db files, d1 d2 respectively. t1 t2 have identical schemas, but different data. I want to append t2 to t1. I suppose the way to do that is to open a connect to d1, use the attach command to reference d2.t2 and issue a

Re: [sqlite] mutex and begin/end transaction

2009-05-01 Thread James Gregurich
in an uncontrollable environment (i.e. a consumer desktop computer) when I can just use NSOperation, boost::thread, and boost::mutex to build a single-process solution that shares data in a normal way between tasks? James Gregurich Engineering Manager Markzware On Apr 29, 2009, at 11:23 PM

Re: [sqlite] mutex and begin/end transaction

2009-05-01 Thread James Gregurich
. There are no facts in science, only observations and any hypothesis is only valid until a better one replaces it. You describe bad, politicized science. James Gregurich wrote: With all due respect, science itself is a set of positions (opinions) which are endorsed by small group of people

Re: [sqlite] mutex and begin/end transaction

2009-04-30 Thread James Gregurich
threaded programs are inherently doomed to be ill-conceived. The development tools and techniques for building concurrent systems are advancing and making concurrency quite feasible. James Gregurich Engineering Manager Markzware On Apr 30, 2009, at 5:01 AM, John Stanton wrote: A position

Re: [sqlite] mutex and begin/end transaction

2009-04-30 Thread James Gregurich
in an uncontrollable environment (i.e. a consumer desktop computer) when I can just use NSOperation, boost::thread, and boost::mutex to build a single-process solution that shares data in a normal way between tasks? James Gregurich Engineering Manager Markzware On Apr 29, 2009, at 11:23 PM

Re: [sqlite] mutex and begin/end transaction

2009-04-30 Thread James Gregurich
, at 4:37 PM, Roger Binns wrote: James Gregurich wrote: So, you suggest I should build a commercial desktop application (for processing print-industry files and presenting them in a UI) in such a way that it spawns multiple processes and communicates with them via the filesystem or IPC

[sqlite] mutex and begin/end transaction

2009-04-29 Thread James Gregurich
howdy! question: for an in-memory db with the threading mode set to serialized, is the internal mutex held for an entire transaction so that one thread won't access the db while another one is in the middle of a transaction with multiple insert statements? thanks for any info. James

Re: [sqlite] mutex and begin/end transaction

2009-04-29 Thread James Gregurich
is a major part of that effort. As I understand it, MS is developing their copy of NSOperation for VS2010. The development landscape is only going to get more threaded as time goes on. -James On Apr 29, 2009, at 10:03 PM, James Gregurich wrote: howdy! question: for an in-memory

Re: [sqlite] multiple writers for in-memory datastore

2008-04-21 Thread James Gregurich
interesting. thanks for the tip. Ill give it some consideration. -James On Apr 21, 2008, at 1:07 :50PM, Scott Hess wrote: If you create a file on disk and set PRAGMA synchronous = OFF, you should get pretty close to the performance of a shared in-memory database on most modern desktop

Re: [sqlite] multiple writers for in-memory datastore

2008-04-20 Thread James Gregurich
for those who may be interested: I ran a test with SQLite version: 3.5.8 I tried the scheme described earlier with each thread sharing a connection but writing into its own attached in-memory db on that connection. Didn't work. all but the first writer thread failed with a SQLITE_ERROR

Re: [sqlite] multiple writers for in-memory datastore

2008-04-20 Thread James Gregurich
. Actually, CoreData is what I intended to use at first. However, I have explored the possibility of directly using SQLite instead to keep my document readers and their data management cross-platform. On Apr 20, 2008, at 8:31 AM, Dennis Cote wrote: James Gregurich wrote: I think I will go

Re: [sqlite] multiple writers for in-memory datastore

2008-04-19 Thread James Gregurich
on simultaneously on the same connection but each insert operation going into a different attached in-memory db. On Apr 19, 2008, at 9:20 AM, Dan wrote: On Apr 19, 2008, at 6:06 AM, James Gregurich wrote: I'll ask this question. The answer is probably no, but I'll ask it for the sake

Re: [sqlite] multiple writers for in-memory datastore

2008-04-19 Thread James Gregurich
-writers locks strategies, etc... On Sat, Apr 19, 2008 at 2:29 PM, James Gregurich [EMAIL PROTECTED] wrote: oh good! That isn't the version that ships with Leopard, but I can live with deploying my own version as part of my app. Will l get the writer parallelism I'm after as long as each thread

Re: [sqlite] multiple writers for in-memory datastore

2008-04-19 Thread James Gregurich
to that filename and registered in this map. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of James Gregurich Sent: sábado, 19 de abril de 2008 17:02 To: General Discussion of SQLite Database Subject: Re: [sqlite] multiple writers for in-memory datastore I

[sqlite] multiple writers for in-memory datastore

2008-04-18 Thread James Gregurich
. Is there a way to attach an existing in-memory store to another in-memory store? If not, how hard would it be to modify the sqlite source to allow such an attachment to be made given the two connection pointers to two independent stores? thanks, James Gregurich

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread James Gregurich
If the sqlite statement had a temporary storage area so that I could load up a bunch of rows and then commit them in one shot so that the lock on the db was not held very long by a single transaction, that would probably work. However, my reading of the documentation leads me to believe

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread James Gregurich
full concurrency on my writer tasks until they are ready to flush their results to the disk file? As I understand it, the attached db won't be locked by reading done on the disk file. thanks, James On Apr 18, 2008, at 10:33 :39AM, Dennis Cote wrote: James Gregurich wrote: If the sqlite

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread James Gregurich
On Apr 18, 2008, at 1:25 :36PM, Dennis Cote wrote: James Gregurich wrote: suppose I create a temporary db file on disk. Each task ( a thread) opens a connection to the temp file and attaches an in-memory db to it. You will have to open the memory database and attach the db file since

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread James Gregurich
On Apr 18, 2008, at 2:33 :32PM, Dennis Cote wrote: To share an attached database the threads must be able to name it, and this is only possible with a file database. you could change the open() function to be able to assign a name to an in-memory db and then keep a mapping of all the names

Re: [sqlite] multiple writers for in-memory datastore

2008-04-18 Thread James Gregurich
I'll ask this question. The answer is probably no, but I'll ask it for the sake of completeness. Suppose I created an in-memory db. I use the attach command to associate an additional in-memory db. Suppose I assign the main db to thread 1 and the associated db to thread 2. Can I share the