Really basic SQLite questions

James Hale james at thehales.id.au
Fri Apr 25 04:49:51 CEST 2014


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


More information about the use-livecode mailing list