ksql is a
lazy man's C/C++ wrapper for the SQLite API interface.
It is written to make sure sloppy programming won't cause your SQLite database to be inconsistent (transactions and
statements open on exit and certain signals).
Specifically, it exits on any database errors; and upon exit (or signal), cleans up open statements, transactions, and databases.
See ksql(3) and friends for details.
It also has some handy security features: a split-process model protecting the database from your application, full RBAC capabilities on the statement level, and immutable stored statements to prevent the application from crafting its own SQL.