Source Distributions
Most open source projects provide a single download that
allows you to configure, build, and install the software with just a handful
of commands. SQLite works a bit differently. Because the most common way to
use SQLite is to integrate the core source directly into a host application,
the source distributions are designed to make integration as simple as
possible. Most of the source distributions contain only source code and
provide minimal (if any) configuration or build support files. This makes it
simpler to integrate SQLite into a host application, but if you want to
build a library or sqlite3
application,
you will often need to do that by hand. As we’ll see, that’s fairly
easy.
The Amalgamation
The official code distribution is known as the amalgamation. The amalgamation is a single C source file that contains the entire SQLite core. It is created by assembling the individual development files into a single C source file that is almost 4 megabytes in size and over 100,000 lines long. The amalgamation, along with its corresponding header file, is all that is needed to integrate SQLite into your application.
The amalgamation has two main advantages. First, with everything in one file, it is extremely easy to integrate SQLite into a host application. Many projects simply copy the amalgamation files into their own source directories. It is also possible to compile the SQLite core into a library and simply link the library into your application.
Second, the amalgamation ...
Get Using SQLite now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.