KSQL(3)

NAME
ksql - yet another SQLite wrapper

LIBRARY
ksql

SYNOPSIS
#include <ksql.h>
enum ksqlc;
struct ksql;
struct ksqlcfg;
struct ksqlstmt;

DESCRIPTION
The ksql library is a “lazy man's” wrapper of a minimal subset of the SQLite C API. It makes interfacing with SQLite easy and fast for you, and safe for your database.

The typical usage scenario is as follows:

1.  allocate a handle with ksql_alloc(3);

2.  open a database connection on that handle with ksql_open(3);

3.  create statements with ksql_stmt_alloc(3) and use them with ksql_bind_double(3), ksql_stmt_double(3), and ksql_stmt_free(3); or

4.  execute statements with ksql_exec(3);

5.  close and free with ksql_free(3).

There's also support for maintaining transactional consistency with ksql_trans_open(3) and ksql_trans_commit(3). Invoke “apropos ksql” to see all functions.

By default, ksql will trigger calls to exit(2) if any of the database functions fail. It will also register an atexit(3) hook that will clean up any open database connections and make sure that SIGABRT and SIGSEGV signals are intercepted and trigger a controlled exit. Thus, if your program fails while performing (say) transactions, or any sort of open database, you won't corrupt the data.

To compile with ksql, use the header file <ksql.h> and link to -lksql -lsqlite3. This library is not thread-safe and does not plan to be. If you're using Linux, you'll also need to link -lbsd, which is used for some minor purposes.

SEE ALSO
sqlite3(3)