Re: [sqlite] More sqlite header questions

2018-02-15 Thread Simon Slavin
On 16 Feb 2018, at 1:39am, Jens Alfke wrote: > On Feb 15, 2018, at 4:53 PM, Simon Slavin wrote: > >> Given the way the documentation is arranged, and the lack of any mention to >> the contrary, I will assume sqlite3_shutdown() is paired with >> sqlite_initialize(). > > There’s a sqlite_i

Re: [sqlite] More sqlite header questions

2018-02-15 Thread Jens Alfke
> On Feb 15, 2018, at 4:53 PM, Simon Slavin wrote: > > Given the way the documentation is arranged, and the lack of any mention to > the contrary, I will assume sqlite3_shutdown() is paired with > sqlite_initialize(). There’s a sqlite_initialize function?? O_o —Jens _

Re: [sqlite] More sqlite header questions

2018-02-15 Thread Simon Slavin
On 15 Feb 2018, at 11:10pm, Jens Alfke wrote: >> On Feb 15, 2018, at 10:09 AM, Simon Slavin wrote: >> >>> 1) I can't be the only programmer who learned to make paired calls ("If you >>> initialise something, it needs deinitializing, if you allocate something, >>> deallocate it."). > > When a

Re: [sqlite] More sqlite header questions

2018-02-15 Thread Jens Alfke
> On Feb 15, 2018, at 10:09 AM, Simon Slavin wrote: > > 1) I can't be the only programmer who learned to make paired calls ("If you > initialise something, it needs deinitializing, if you allocate something, > deallocate it."). When a process exits, its resources are automatically cleaned up

Re: [sqlite] More sqlite header questions

2018-02-15 Thread Simon Slavin
On 15 Feb 2018, at 5:30pm, Dan Kennedy wrote: > (B) is an understandably common misconception. sqlite3_shutdown() frees > resources that were allocated by sqlite3_initialize() or > sqlite3_auto_extension() and must be called after all SQLite connections have > been closed. These resources are

Re: [sqlite] More sqlite header questions

2018-02-15 Thread Dan Kennedy
On 02/14/2018 04:03 AM, Simon Slavin wrote: On 13 Feb 2018, at 8:22pm, Chris Brody wrote: Thanks Simon for the quick response. You're welcome. Can you clarify the following: - Does this imply that a SQLite database may be left in some kind of unrecoverable, corrupted, or otherwise invalid s

Re: [sqlite] More sqlite header questions

2018-02-13 Thread Simon Slavin
On 13 Feb 2018, at 9:17pm, Richard Hipp wrote: > On 2/13/18, Jens Alfke wrote: > >> On iOS (can’t speak for Android) apps do get notice that they’re going to be >> terminated. > > I am told that that notification is best-effort and is not guaranteed > to occur, nor is it guaranteed to be deliv

Re: [sqlite] More sqlite header questions

2018-02-13 Thread Richard Hipp
On 2/13/18, Jens Alfke wrote: > > On iOS (can’t speak for Android) apps do get notice that they’re going to be > terminated. I am told that that notification is best-effort and is not guaranteed to occur, nor is it guaranteed to be delivered to the application prior to the application being forci

Re: [sqlite] More sqlite header questions

2018-02-13 Thread Jens Alfke
> On Feb 13, 2018, at 12:22 PM, Chris Brody wrote: > > I think this is especially important for mobile apps which may be > terminated without notice, especially when using hybrid app frameworks > such as Cordova/PhoneGap. On iOS (can’t speak for Android) apps do get notice that they’re going t

Re: [sqlite] More sqlite header questions

2018-02-13 Thread Simon Slavin
On 13 Feb 2018, at 8:22pm, Chris Brody wrote: > Thanks Simon for the quick response. You're welcome. > Can you clarify the following: > - Does this imply that a SQLite database may be left in some kind of > unrecoverable, corrupted, or otherwise invalid state in case an > application would term

Re: [sqlite] More sqlite header questions

2018-02-13 Thread Richard Hipp
On 2/13/18, Chris Brody wrote: > - Does this imply that a SQLite database may be left in some kind of > unrecoverable, corrupted, or otherwise invalid state in case an > application would terminate without calling sqlite3_close() on all > open database connections? No. The database might be left

Re: [sqlite] More sqlite header questions

2018-02-13 Thread Chris Brody
On Tue, Feb 13, 2018 at 2:03 PM, Simon Slavin wrote: > [...] > There are two possibilities: > > A) The SQLite API was used correctly, including being allowed to close all > files it opened. > B) Any other situation. > > If (A) happened, you can predict things about the database header and you can

Re: [sqlite] More sqlite header questions

2018-02-13 Thread Simon Slavin
On 13 Feb 2018, at 5:49pm, Chris Brody wrote: > I still have the following questions: Chris, There are two possibilities: A) The SQLite API was used correctly, including being allowed to close all files it opened. B) Any other situation. If (A) happened, you can predict things about the data

[sqlite] More sqlite header questions

2018-02-13 Thread Chris Brody
Thanks to DRH for the quick answer. So I would infer that the sqlite file header would normally be in a consistent state, and only be in an inconsistent or otherwise incorrect state in the following cases: 1. modification (write) is in progress (until the sqlite3 code has a chance to finish the mod