[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Differences between Lua-Sqlite3 and LuaSQLite
- From: Doug Currie <doug.currie@...>
- Date: Thu, 19 Mar 2009 13:04:22 -0400
On Mar 19, 2009, at 12:49 AM, Joshua Jensen wrote:
Can the authors tell me what makes one better than the other? Does
Lua-SQLite support more SQLite 3 features, because it is newer?
Probably, but if it is a feature you don't need it doesn't matter.
The history of luasqlite is that Tiago and I each had a sqlite (v2.x)
library, and we combined efforts for sqlite3. At the time we felt we
got the feature set "right," at least for us. Thomas Lauer contributed
most of the documentation, and I massaged it and converted it to POD
format. We tend to update the library when we need it for projects,
which most recently, but not very recently, has been my doing.
* Lua-Sqlite3 has a more convenient (IMHO) interface where I can
write things like stmt:bind(valueA, valueB):exec(). The equivalent
in Lua-SQLite is 3 statements: stmt:bind_values(valueA, valueB);
It is difficult to find a good balance between convenience and
robustness. Chaining prepare, bind, execute, reset is convenient, but
omits error checking and recovery. My projects are usually production
applications, and error recovery and reporting are critical, so the
convenience stuff is not so important to me. Nevertheless I spent some
time making sure that one-off queries were fairly easy, and that the
prepared-statements used were cleaned up properly depending on whether
they are persistent or transient statements.
Both sqlite libraries (and others) are being used regularly. Perhaps
others on the mailing list will have reasons for choosing one over
another. I use luasqlite because it does what I need and I am more
familiar with it.