[sqlite] “btreeInitPage() returns error code 11”

2016-02-02 Thread Felipe Gasper
Hi all, I?ve got a corrupt SQLite database, and I?m trying to figure out what produced the corruption. A ?pragma integrity_check? on it yielded the following. Does this trip anyone?s ?danger sense? of what may have happened? Thank you! -FG SQLite

[sqlite] hard links and SQLite

2016-01-12 Thread Felipe Gasper
On 11 Jan 2016 9:06 PM, Rowan Worth wrote: > On 12 January 2016 at 03:00, Felipe Gasper wrote: > >> On 11 Jan 2016 1:45 PM, Scott Hess wrote: >> >>> >>> As far as preventing the other process from using it before the schema >>> exists, do "SELE

[sqlite] hard links and SQLite

2016-01-11 Thread Felipe Gasper
On 11 Jan 2016 1:45 PM, Scott Hess wrote: > > As far as preventing the other process from using it before the schema > exists, do "SELECT count(*) FROM sqlite_master", and if the result is 0, > the schema does not exist. If you create the schema as a transaction, that > will be atomic. But in

[sqlite] hard links and SQLite

2016-01-11 Thread Felipe Gasper
On 11 Jan 2016 1:30 PM, Bernardo Sulzbach wrote: >> What have folks here done to avoid the race condition originally described? >> I?ve seen some documentation of SQLite and hard links but > > Your message appears to be truncated. Oops! Nothing earth-shattering ? I meant to put ?but didn?t think

[sqlite] hard links and SQLite

2016-01-11 Thread Felipe Gasper
Hi all, To prevent race conditions where a 2nd process accesses a newly-created SQLite file before the creator process can set up the schema, I?ve implemented logic like this: - create SQLite file as a .tmp beside permanent location - BEGIN EXCLUSIVE LOCK - hard-link the temp file to

[sqlite] SQLite, fork(), and exec()

2015-08-10 Thread Felipe Gasper
Hi everyone, Does SQLite need to have nothing at all to do with fork()? Even when the fork() immediately precedes an exec(), and the exec()ed command has nothing to do with SQLite? Or is it only a problem if the child process *uses* SQLite? -F

[sqlite] insert or increment?

2015-03-20 Thread Felipe Gasper
Hello, I?m looking for logic like this: INSERT data ON CONFLICT oldrow.col1 += oldrow.col2 Does SQLite have anything that would make this simpler than: 1) UPDATE 2) if 0 rows updated, then INSERT Thank you! ?? -FG

[sqlite] SQLITE_OPEN_EXCLUSIVE

2015-03-15 Thread Felipe Gasper
"Violent agreement". :-) Sent from my android device. -Original Message- From: Simon Davies <simon.james.dav...@gmail.com> To: General Discussion of SQLite Database Sent: Sun, 15 Mar 2015 9:08 AM Subject: Re: [sqlite] SQLITE_OPEN_EXCLUSIVE On 15 March 2015 at 12:5

[sqlite] SQLITE_OPEN_EXCLUSIVE

2015-03-15 Thread Felipe Gasper
LUSIVE On 15 March 2015 at 06:06, Felipe Gasper wrote: > Hi all, > > Does the SQLITE_OPEN_EXCLUSIVE flag exist as analogous to O_EXCL in > C open()? i.e., is this how I can say, ?open a database, but only if it?s a > new database?? https://www.sqlite.org/capi3ref

[sqlite] SQLITE_OPEN_EXCLUSIVE

2015-03-15 Thread Felipe Gasper
sqlite] SQLITE_OPEN_EXCLUSIVE On 15 Mar 2015, at 6:06am, Felipe Gasper wrote: > is this how I can say, ?open a database, but only if it?s a new database?? There is no mode in SQLite which does that. You can tell it to do the opposite (only open an existing file, return an error if no file exists) but no

[sqlite] SQLITE_OPEN_EXCLUSIVE

2015-03-15 Thread Felipe Gasper
Hi all, Does the SQLITE_OPEN_EXCLUSIVE flag exist as analogous to O_EXCL in C open()? i.e., is this how I can say, ?open a database, but only if it?s a new database?? Thank you! -Felipe Gasper Houston, TX