Really basic SQLite questions

Mike Kerner MikeKerner at roadrunner.com
Thu Apr 24 23:48:29 EDT 2014


1's easy, so I'll answer that:
sqlite is a text file that is formatted so that it can be treated like a
regular db.  So open when you start and close when you're done.  I have had
numerous cases on mobile where the app does not get to close the db before
it crashes for whatever reason with no ill effects.  Occasionally I have
had a whine if I try to open a db on desktop that was opened but not
closed, but in general, things are forgiving.

Yes, just open the connection when you start for all your db's and close
when you're done.  No, I don't think there is anything wrong with
reasserting the connection - at least I have never had an issue that I can
recall, but I generally open the db's in preOpenStack.


On Thu, Apr 24, 2014 at 10:49 PM, James Hale <james at thehales.id.au> wrote:

> 1. Open and close database connections. When?
> Obviously you need to open a connection to access a database, but when do
> you need to close it?
> Does it close without you doing anything?
> I have the need to connect to four db's while running my app.
> Access to a couple of these is sporadic but constant across a user session
> with the app.
> Can I just open a connection to them all on the app's launch and then
> close the connection of quitting? Currently I reassert the connection on
> most accesses. Is this a bad thing to do?
>
> 2. SQLite's new ability to load a runtime extension. What does it attach
> to?
> I have compiled a couple of extensions to SQLite for my app. I use them in
> two distinct db's that I connect to. Do I need to load the extension for
> each db or only once.
> In other words is it loaded for the engine itself or does the load only
> apply to the specific database I am connecting to at the time?
>
> Thanks in advance
>
> James
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the use-livecode mailing list