D. Richard Hipp wrote:
This released is labeled "alpha" but it is still very well
tested. By being "alpha" it means that there is still a
small window of opportunity during when users can suggest
API changes. Once we go to beta (in about a week) no more
changes will be accepted. So if you want to suggest changes,
please do so quickly.
Here's a suggestion for an API change:
A lot of my code where I don't have fixed queries ends up looking something like this:
int rc; char * pSql;
pSql = sqlite3_mprintf(queryPattern, argList); if (pSql == NULL) { // error case } else { rc = sqlite3_exec(database, pSql, 0, 0, 0); sqlite3_free(pSql); if (rc != SQLITE_OK) { // error case } }
For the most part I don't use sqlite3_exec callbacks (for such situations there is
prepare/update/finish), nor do I use the sqlite3_exec errmsg, which just makes for
another variable to declare and then free in the error cases. (it was helpful when I
was first learning about sqlite, but is well expressed by the return code).
So it would be nice if sqlite3_exec or another function combined the features of
the current sqlite3_exec and sqlite3_mprintf:
rc = sqlite3_mprintf_exec(database, queryPattern, argList);
Ok yeah maybe it's a trivial change, and easily re-created by the end user with a
wrapper function (not helping my argument here, am I...) but for the people who
don't think to wrap it, or who don't do much error checking, it would be a boon.
-Eli