Module: sqlite

About this module

This module is a wrapper around SQLite. SQLite is a in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. More info at SQLite's about page.

Interface overview and API documentation

The SQLite documentation is your friend. SQLite version 3 C/C++ API reference

Implementation description

SQLite is used in core so far only by the database module. No other modules should access SQLite's APIs directly. To use sql databases in your project, check the database module documentation. So far the API is refined to support Web SQL Databases, but improvements are accepted.

IMPORTANT: Sqlite updates

Because SQLite is a 3rd party library, it needs to be periodically updated. The following steps need to be followed:

  1. Run the modules/sqlite/update-sqlute.py script which downloads it and places it in the sqlite/src folder. You still have to evaluate if everything seems ok, including the download script, and commit.
  2. An outstanding patch for SQLite that allows SQLite to interrupt and resume queries, plus fix a couple compile warnings, needs to be applied. See tag sqlite-opera-patch. If the patch does not apply cleanly, then a new patch needs to be produced, commited, and the tag needs to be updated to refer to the new commit.
  3. Run the selftests for the sqlite module. The tests are not exaustive, but they check that everything compile and works, and they check as well that the patch above is working properly. If the selftests fail then something is wrong.