Documentation Source Text

Artifact Content
Login

Artifact 770285b621b326954a85e4aaaede8d11c61b4594:


<title>How To Obtain Raw SQLite Source Code</title>
<tcl>hd_keywords {canonical source code} {get the canonical source code}</tcl>

<h2>1.0 Introduction</h2>

<p>Most programmers compile SQLite into their applications using
the [amalgamation].  The [amalgamation] is C-code but it is not
"source code".  The [amalgamation] is generated from source code
by scripts.

<p>This document describes how to obtain the canonical source code
for SQLite - the raw source files from which the amalgamation is
built.  See the [How To Compile SQLite] page for additional information
on what to do with the canonical source code once it is obtained.

<h2>2.0 Direct Downloads</h2>

<p>Snapshots of official releases of SQLite source code can often
be obtained directly from the [download page] of the SQLite website.
Even if the specific version desired is not listed on the download page,
the naming conventions are fairly clear and so programmers can often
guess the name of an historical release and download it that way.

<h2>3.0 Obtaining Code Directly From the Version Control System</h2>

<p>For any historical version of SQLite, the source tree can be obtained
from the [http://www.fossil-scm.org/|Fossil] version control system,
either downloading a tarball or ZIP archive for a specific version, or
by cloning the entire project history.

<p>SQLite sources are maintained on three geographically dispersed
servers:

<blockquote>
[http://www.sqlite.org/cgi/src] (Dallas)<br>
[http://www2.sqlite.org/cgi/src] (Newark)<br>
[http://www3.sqlite.org/cgi/src] (Fremont)<br>
</blockquote>

<p>The documentation is maintained in separate source repositories on
those same servers:

<blockquote>
[http://www.sqlite.org/cgi/docsrc] (Dallas)<br>
[http://www2.sqlite.org/cgi/docsrc] (Newark)<br>
[http://www3.sqlite.org/cgi/docsrc] (Fremont)<br>
</blockquote>

<p>To download a specific historical version, first locate the specific
version desired by visiting the timeline page on one of these servers
(for example: [http://www.sqlite.org/cgi/src/timeline]).  If
you know the approximate date of the version you want to download, you
can add a query parameter like "c=YYYY-MM-DD" to the "timeline" URL to
see a timeline centered on that date.  For example, to see all the check-ins
that occurred around August 26, 2013, visit
[http://www.sqlite.org/cgi/src/timeline?c=2013-08-26].
If you are looking for an official release, you might also visit the
page that lists all check-ins tagged with "release":
[http://www.sqlite.org/cgi/src/timeline?t=release&n=0].

<p>Once you locate a specific version, click on the hyperlink for that
to go to the "Check-in Information Page".
Then click on either the "Tarball" link or the
"ZIP archive" link to download the complete source tree.

<tcl>hd_fragment {clone} {clone the entire repository}</tcl>
<h2>4.0 Cloning The Complete Development History</h2>

<p>To clone the entire history of SQLite, first go to the
[http://www.fossil-scm.org/download.html] page and grab a precompiled binary
for the Fossil version control program.  (Or get the source code on the
same page and compile it yourself.)  Fossil is a completely stand-alone
program, so install it simply by putting the "fossil" or "fossil.exe"
executable someplace on your $PATH or %PATH%.  Then enter:

<blockquote><pre>
fossil clone http://www.sqlite.org/cgi/src sqlite.fossil
</pre></blockquote>

<p>That command will make a copy of the complete development history of
SQLite into the "sqlite.fossil" file on your computer.  Making this copy
takes about a minute and uses about 32 megabytes of transfer.  After
making the copy, "open" the repository by typing:

<blockquote><pre>
fossil open sqlite.fossil
</pre></blockquote>

<p>This second command will "checkout" the latest check-in from the SQLite
source tree into your current directory.  Subsequently, you can easily switch
to a different version by typing:

<blockquote><pre>
fossil update VERSION
</pre></blockquote>

<p>Where VERSION can be a branch name (like "trunk" or "session") to get the
latest check-in on a specific branch, or VERSION can be a SHA1 hash or a
prefix of a SHA1 hash for a specific check-in, or VERSION can be a tag
such as "version-3.8.8".  Every time you run "fossil update" it will
automatically reach out to the original repository at
http://www.sqlite.org/cgi/src to obtain new check-ins that might have been
made by others since your previous update.