Sqlite
Sqlite (sqlite3) was chosen because it is a free public domain database. It's small, embeddable and requires very little administration for its use, yet it's also SQL (and not just key/value pairs, etc.).
From www.sqlite.org:
SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine. Features include:
- Transactions are atomic, consistent, isolated, and durable (ACID) even after system crashes and power failures.
- Zero-configuration - no setup or administration needed.
- Implements most of SQL92. (Features not supported)
- A complete database is stored in a single disk file.
- Database files can be freely shared between machines with different byte orders.
- Supports terabyte-sized databases and gigabyte-sized strings and blobs. (See limits.html.)
- Small code footprint: less than 250KiB fully configured or less than 150KiB with optional features omitted.
- Faster than popular client/server database engines for most common operations.
- Simple, easy to use API.
- TCL bindings included. Bindings for many other languages available separately.
- Well-commented source code with over 98% test coverage.
- Available as a single ANSI-C source-code file that you can easily drop into another project.
- Self-contained: no external dependencies.
- Sources are in the public domain. Use for any purpose.
The SQLite distribution comes with a standalone command-line access program (sqlite) that can be used to administer an SQLite database and which serves as an example of how to use the SQLite library.
ACID Compliance
In addition to their data model, most practical databases ("transactional databases") attempt to enforce a database transaction . Ideally, the database software should enforce the ACID rules, summarized here:
- Atomicity: Either all the tasks in a transaction must be done, or none of them. The transaction must be completed, or else it must be undone (rolled back).
- Consistency: Every transaction must preserve the constraints integrity the declared rules consistency of the database. It cannot place the data in a contradictory state.
- Isolation: Two simultaneous transactions cannot interfere with one another. Intermediate results within a transaction are not visible to other transactions.
- Durability: Completed transactions cannot be aborted later or their results discarded. They must persist through (for instance) restarts of the DBMS after crashes
Xql3 sqlite3 class
The Xql3 class used in these examples comes from sqlite3 stuff from Neurillion ...