Re: [sqlite] Use sqlite3_update_hook() to watch for changes

2009-03-20 Thread Nicolas Williams
On Fri, Mar 20, 2009 at 07:35:07PM -0700, Roger Binns wrote: > Ricky Huang wrote: > > My question is, does SQLite offer ways of hooking up a second > > application to changes in a shared DB without polling? > > Nope. However your operating system should provide a notification for > file changes

Re: [sqlite] Use sqlite3_update_hook() to watch for changes

2009-03-20 Thread Roger Binns
Ricky Huang wrote: > My question is, does SQLite offer ways of hooking up a second > application to changes in a shared DB without polling? Nope. However your operating system should provide a notification for file changes (eg inotify/dnotify on Linux, FindFirstChangeNotification on Windows).

[sqlite] Use sqlite3_update_hook() to watch for changes

2009-03-20 Thread Ricky Huang
Here's my scenario, I have two applications, reader and a writer, and a shared database. Writer will be writing changes to the database and reader will be reading. Originally my idea was for the reader to use sqlite3_update_hook() to watch for database changes. But after I got the code w

Re: [sqlite] Strange SQLITE_CORRUPT error

2009-03-20 Thread D. Richard Hipp
On Mar 20, 2009, at 5:43 PM, Kim, Albert wrote: > Hi Richard, > > Thanks for your quick response! The call stack at the point when > the SQLITE_CORRUPT_BKPT occurs looks like this: > > sqlite3VdbeExec > case OP_OpenWrite: > sqlite3BtreeCursor > btreeCursor > getAndInitPage > sqlite3BtreeGetP

Re: [sqlite] Strange SQLITE_CORRUPT error

2009-03-20 Thread Kim, Albert
Hi Richard, Thanks for your quick response! The call stack at the point when the SQLITE_CORRUPT_BKPT occurs looks like this: sqlite3VdbeExec case OP_OpenWrite: sqlite3BtreeCursor btreeCursor getAndInitPage sqlite3BtreeGetPage sqlite3PagerAcquire pagerAcquire It appears that the invalid page

Re: [sqlite] [newbie] Binary and text-file storage in SQL(ite).

2009-03-20 Thread Teg
Hello All, I have DB's with 5 Gb worth of images in them and I find the performance to be more than acceptable for my purpose which is storage and display. The images are in the 250K to 3 megabyte range in size. The benefit is that you have everything in one place so, moving things around is easy.

Re: [sqlite] problems with shared cache?

2009-03-20 Thread Griggs, Donald
> However, when I ask the user to send me their deck, I find that: > > sqlite> pragma integrity_check; > integrity_check > --- > ok > sqlite> select id, count(id) from cards group by id having > count(id) >> 1; > sqlite> > > Any ideas

Re: [sqlite] problems with shared cache?

2009-03-20 Thread Damien Elmes
Yes, but I always insert with null: self.s.statement( "create temporary table undoLog (seq integer primary key, sql text)") after insert on %(t)s begin insert into undoLog values (null, ...) after update on %(t)s begin insert into undoLog values (null, 'update %(t)s .. etc

Re: [sqlite] Pre-compiled products

2009-03-20 Thread William Kyngesburye
Indeed, configuring sqlite to compile as a dylib on OSX is easy (it's the default). I think what Richard may mean is packaging an installer so that the dylib is installed where it needs to be. As you point out Jay, dylibs have additional metadata, part of that is the full path to the dylib,

[sqlite] [newbie] Binary and text-file storage in SQL(ite).

2009-03-20 Thread Rob Sciuk
Nuno wrote: > Yeah, a religious question, i know, but what's recomended?... > > I have a small site that may have some images for some products. Said > products may also have descriptions. I have other small sites and one > where i'd like to manipulate large texts (say around 5 paragraphs... > ~5

Re: [sqlite] Pre-compiled products

2009-03-20 Thread P Kishor
On Fri, Mar 20, 2009 at 10:27 AM, Jay A. Kreibich wrote: > On Fri, Mar 20, 2009 at 10:46:57AM -0400, D. Richard Hipp scratched on the > wall: >> >> On Mar 20, 2009, at 10:43 AM, Jay A. Kreibich wrote: >> >>> >>>  I suppose this is mostly a question for the SQLite development team: >>> >>>  I'm wo

Re: [sqlite] Pre-compiled products

2009-03-20 Thread Jay A. Kreibich
On Fri, Mar 20, 2009 at 10:46:57AM -0400, D. Richard Hipp scratched on the wall: > > On Mar 20, 2009, at 10:43 AM, Jay A. Kreibich wrote: > >> >> I suppose this is mostly a question for the SQLite development team: >> >> I'm wondering why the dynamic libraries for the SQLite core and >> TCL-SQLi

Re: [sqlite] Pre-compiled products

2009-03-20 Thread D. Richard Hipp
On Mar 20, 2009, at 10:43 AM, Jay A. Kreibich wrote: > > I suppose this is mostly a question for the SQLite development team: > > I'm wondering why the dynamic libraries for the SQLite core and > TCL-SQLite bindings are not available for Mac OS X (.dylib), when > they are for Linux (.so) and

[sqlite] Pre-compiled products

2009-03-20 Thread Jay A. Kreibich
I suppose this is mostly a question for the SQLite development team: I'm wondering why the dynamic libraries for the SQLite core and TCL-SQLite bindings are not available for Mac OS X (.dylib), when they are for Linux (.so) and Windows (.DLL). -j -- Jay A. Kreibich < J A Y @ K R E

Re: [sqlite] What am I doing wrong ?

2009-03-20 Thread Olivier FAURAX
Igor Tandetnik a écrit : > Olivier FAURAX wrote: >> I tried with -1 and the length value of the string, but it didn't >> help... > > Post a small complete compilable program that reproduces the problem. I > don't see anything wrong in the code you've shown - hence, the problem > is likely in the

Re: [sqlite] writting a text file from sqlite db in C

2009-03-20 Thread mrobi002
Thanks for your help. I checked those sites, and I worked with sqlite3.exe using the command line tool, no problems, however I can not find anywhere samples of how to applied these commands in C. Thru trial and error, I can now use sqlite3_open(), sqlite3_close(), to open and close databases as w

Re: [sqlite] checking if a record exist or not

2009-03-20 Thread jose isaias cabrera
"Igor Tandetnik" wrote... > jose isaias cabrera > wrote: >> I am updating an sqlite db from another sqlite db and it is working >> fine, unless the record does not exists. ie. >> >> "ATTACH db2 AS client; "; >> >> BEGIN; >> INSERT OR REPLACE INTO LSOpenJobs >> SELECT * FROM

Re: [sqlite] problems with shared cache?

2009-03-20 Thread Dan
Does the "undolog" table, or whatever you're using in its place, have a primary key? On Mar 20, 2009, at 1:20 PM, Damien Elmes wrote: > Well, those 3 x the number of tables in the Db. > > On Fri, Mar 20, 2009 at 3:17 PM, Damien Elmes > wrote: >> Yep - but only the three listed on this page:

Re: [sqlite] sqlite3 --version showing the wrong version

2009-03-20 Thread Jean-Denis Muys
On 3/20/09 10:41 AM, "erfon haubenstock" wrote: > > Hey Jean-Denis! I think you may not have seen my most recent post : D > > I used the link you sent me (i think it was yours) that explained that the > local .bash_login could be overriding my .profile. I copied the contents of > .profile in

Re: [sqlite] sqlite3 --version showing the wrong version

2009-03-20 Thread Jean-Denis Muys
On 3/19/09 11:35 PM, "P Kishor" wrote: > > why make things so difficult for yourself? > > download the amalgamation source code and untar/unzip it somwhere. > > type ./configure followed by make && sudo make install > > this will put your sqlite libraries under /usr/local/ > > type /usr/loc

Re: [sqlite] sqlite3 --version showing the wrong version

2009-03-20 Thread erfon haubenstock
Hey Jean-Denis! I think you may not have seen my most recent post : D I used the link you sent me (i think it was yours) that explained that the local .bash_login could be overriding my .profile. I copied the contents of .profile into my .bash_login and now my port command works just fine! I a

Re: [sqlite] sqlite3 --version showing the wrong version

2009-03-20 Thread Jean-Denis Muys
On 3/19/09 11:29 PM, "erfon haubenstock" wrote: > > Hi again. Thanks for trying to help me by the way : D > > I tried relauching terminal and even restarting my computer, but to no > avail. > > I'm not totally sure I understand when you say: > > One common pitfall here is that you must open