Version 1.1.0 introduced the following change: When a command results in an error, the library will attempt to close the database and clear the database variable before the error is returned to your script.
Could I please request that in future versions that behaviour be optional or something? It causes problems for me.
I don’t think an error with one command is necessarily fatal to the whole script. In one of my scripts, for instance, I have a feature that allows a user to enter an sqlite query in a dialog, and then SQLite Lib uses that as the sql string parameter to run a query command and display the results using Myriad Tables Lib. It runs in a repeat loop so you can run as many queries on the same db as you like. If one query fails, I just display an error alert and the user should then be allowed to just run another query, but since v1.1.0 the db is closed and the variable that points to it cleared thus any subsequent queries throw an error. There are other similar examples.
I suppose a work around for me might be to have a function to reopen the db which I can call from the on error part of a try block if the error code indicates that its an error with SQLite Lib. But to make that elegant would involve lots of try blocks and conditional error handling, or in other words much more code.
In contrast, the problem that is being solved by the change in v1.1.0 never seemed like much of a problem to me. I called a function in the on quit handler which would close the db if it was open and I basically wrapped the contents of the on run handler in a try block which would call the on quit handler if a fatal error was encountered, so either way the clean up function would get called.