[sqlite] fprintf(stderr,...) wrote over my database.........

2008-03-24 Thread Mark Gilbert
Anyone seen this ? - My app is running happily like it has for years. Something happens.. - Result is that my logging which normally goes to a completely different file (connected to stderr with freopen) ends up connected to the SQLite database file, and writes all over the start of the f

Re: [sqlite] CREATE INDEX problem - answer

2008-02-29 Thread Mark Gilbert
I have solved my problem below I am trying to add an index to my database, but the following code is failing in CREATE INDEX with error 14 (unable to open Database file). rc = sqlite3_open(OurDataBaseName, &db); if (rc) { fprintf(stderr, "sqlite3_open returned

Re: [sqlite] Optimization Question for SQLite Experts

2008-02-29 Thread Mark Gilbert
s and one to >get all leaves. Much faster and with 15000 leaves should have plenty of >space to hold the data in memory, especially if you're only storing ids and >references. > >HTH, > >Sam > > >On Thu, Feb 28, 2008 at 7:00 PM, Mark Gilbert <[EMAIL PROTEC

[sqlite] Unable to Open Database File when creating Index

2008-02-29 Thread Mark Gilbert
Folks. I am trying to add an index to my database, but the following code is failing in CREATE INDEX with error 14 (unable to open Database file). rc = sqlite3_open(OurDataBaseName, &db); if (rc) { fprintf(stderr, "sqlite3_open returned %d\n",rc); return -1; } rc = sqlite3_exec(

Re: [sqlite] Optimization Question for SQLite Experts

2008-02-28 Thread Mark Gilbert
Folks. Looking for some advice from hardened SQliters... - Our application uses an SQLite 3.4.1 database with 8 tables. 1 of the tables may contain tens or maybe hundreds of thousands of records with about 30 fields. - The tables form a linked tree type hierarchy where one table is the trunk

Re: [sqlite] Optimization Question - multithread prepare ?

2008-02-20 Thread Mark Gilbert
> > > - We don't currently prepare SQL statements in advance, would this >> technique benefit from somehow preparing statements *before* that >> thread gets the lock on the database ? Can we have multiple threads >> using the SAME database connection preparing SQL Queries at the same >> time

[sqlite] Optimization Question - multithread prepare ?

2008-02-20 Thread Mark Gilbert
Folks. Our application uses SQlite on Mac OSX. It is a central data hub for a larger infrastructure and manages data coming in from some clients, and requests for data from other clients, using our own XML based protocols via TCPIP. Its somewhat like a web server with a backend system supplyi

[sqlite] Full Text Search

2007-06-10 Thread Mark Gilbert
Folks. I have just started learning about Full Text search in SQlite, and I have some questions 1) With the Amalgamated Sqlite, I guess to enable FTS I just #define SQLITE_ENABLE_FTS2 at the start of sqlite3.c Is there anything else I have to do to switch it on ? 2) If I want to do a full

[sqlite] ALTER TABLE ADD COLUMN - strange behaviour....Mac OSX

2007-06-03 Thread Mark Gilbert
Folks. I had been struggling to implement ALTER TABLE ADD COLUMN in my app to change the database structure. However I would continuously face a locked database error. After much experimentation I have come to a very very strange conclusion. In my app if I do this: -start app -open database

[sqlite] Sqlite 3 Crash on OSX

2007-06-01 Thread Mark Gilbert
Folks. My app just crashed in the field randomly after some time running fine. Thread 12 Crashed: 0 libsqlite3.0.dylib 0x9406e587 sqlite3pager_get + 390 1 libsqlite3.0.dylib 0x94054275 sqlite3BtreeCopyFile + 381 2 libsqlite3.0.dylib 0x9405

[sqlite] Macintosh + Amalgamation - Cursor Struct is already defined in Mac

2007-05-20 Thread Mark Gilbert
Folks. I am trying to include the amalgamation sqlite3.c file into my project (instead of linking to the built in library). I am on OSX 10.4.9 Unfortunately sqlite3.c redefines a structure called Cursor which is already defined in Quickdraw.h which is fundamental part of Mac. Any sugges

[sqlite] Building a newer SQlite3 dylib/framework for XCode ?

2007-05-15 Thread Mark Gilbert
app itself). An app like SQLiteManager is doing exactly what I need - it seems to have a newer version embedded, and the SQL I need to run in my own app (which fails with the OS library) is already working perfectly in SQLiteManager. Any assistance would be most welcome. Thanks Mark Gilbert.

[sqlite] Building a newer SQlite3 dylib/framework for XCode ?

2007-05-12 Thread Mark Gilbert
app itself). An app like SQLiteManager is doing exactly what I need - it seems to have a newer version embedded, and the SQL I need to run in my own app (which fails with the OS library) is already working perfectly in SQLiteManager. Any assistance would be most welcome. Thanks Ma