| 1 |
<!DOCTYPE html> |
| 2 |
<html><head> |
| 3 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 4 |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
| 5 |
<link href="sqlite.css" rel="stylesheet"> |
| 6 |
<title>How To Download Canonical SQLite Source Code</title> |
| 7 |
<!-- path= --> |
| 8 |
</head> |
| 9 |
<body> |
| 10 |
<div class=nosearch> |
| 11 |
<a href="index.html"> |
| 12 |
<img class="logo" src="images/sqlite370_banner.svg" alt="SQLite" border="0"> |
| 13 |
</a> |
| 14 |
<div><!-- IE hack to prevent disappearing logo --></div> |
| 15 |
<div class="tagline desktoponly"> |
| 16 |
Small. Fast. Reliable.<br>Choose any three. |
| 17 |
</div> |
| 18 |
<div class="menu mainmenu"> |
| 19 |
<ul> |
| 20 |
<li><a href="index.html">Home</a> |
| 21 |
<li class='mobileonly'><a href="javascript:void(0)" onclick='toggle_div("submenu")'>Menu</a> |
| 22 |
<li class='wideonly'><a href='about.html'>About</a> |
| 23 |
<li class='desktoponly'><a href="docs.html">Documentation</a> |
| 24 |
<li class='desktoponly'><a href="download.html">Download</a> |
| 25 |
<li class='wideonly'><a href='copyright.html'>License</a> |
| 26 |
<li class='desktoponly'><a href="support.html">Support</a> |
| 27 |
<li class='desktoponly'><a href="prosupport.html">Purchase</a> |
| 28 |
<li class='search' id='search_menubutton'> |
| 29 |
<a href="javascript:void(0)" onclick='toggle_search()'>Search</a> |
| 30 |
</ul> |
| 31 |
</div> |
| 32 |
<div class="menu submenu" id="submenu"> |
| 33 |
<ul> |
| 34 |
<li><a href='about.html'>About</a> |
| 35 |
<li><a href='docs.html'>Documentation</a> |
| 36 |
<li><a href='download.html'>Download</a> |
| 37 |
<li><a href='support.html'>Support</a> |
| 38 |
<li><a href='prosupport.html'>Purchase</a> |
| 39 |
</ul> |
| 40 |
</div> |
| 41 |
<div class="searchmenu" id="searchmenu"> |
| 42 |
<form method="GET" action="search"> |
| 43 |
<select name="s" id="searchtype"> |
| 44 |
<option value="d">Search Documentation</option> |
| 45 |
<option value="c">Search Changelog</option> |
| 46 |
</select> |
| 47 |
<input type="text" name="q" id="searchbox" value=""> |
| 48 |
<input type="submit" value="Go"> |
| 49 |
</form> |
| 50 |
</div> |
| 51 |
</div> |
| 52 |
<script> |
| 53 |
function toggle_div(nm) { |
| 54 |
var w = document.getElementById(nm); |
| 55 |
if( w.style.display=="block" ){ |
| 56 |
w.style.display = "none"; |
| 57 |
}else{ |
| 58 |
w.style.display = "block"; |
| 59 |
} |
| 60 |
} |
| 61 |
function toggle_search() { |
| 62 |
var w = document.getElementById("searchmenu"); |
| 63 |
if( w.style.display=="block" ){ |
| 64 |
w.style.display = "none"; |
| 65 |
} else { |
| 66 |
w.style.display = "block"; |
| 67 |
setTimeout(function(){ |
| 68 |
document.getElementById("searchbox").focus() |
| 69 |
}, 30); |
| 70 |
} |
| 71 |
} |
| 72 |
function div_off(nm){document.getElementById(nm).style.display="none";} |
| 73 |
window.onbeforeunload = function(e){div_off("submenu");} |
| 74 |
/* Disable the Search feature if we are not operating from CGI, since */ |
| 75 |
/* Search is accomplished using CGI and will not work without it. */ |
| 76 |
if( !location.origin || !location.origin.match || !location.origin.match(/http/) ){ |
| 77 |
document.getElementById("search_menubutton").style.display = "none"; |
| 78 |
} |
| 79 |
/* Used by the Hide/Show button beside syntax diagrams, to toggle the */ |
| 80 |
function hideorshow(btn,obj){ |
| 81 |
var x = document.getElementById(obj); |
| 82 |
var b = document.getElementById(btn); |
| 83 |
if( x.style.display!='none' ){ |
| 84 |
x.style.display = 'none'; |
| 85 |
b.innerHTML='show'; |
| 86 |
}else{ |
| 87 |
x.style.display = ''; |
| 88 |
b.innerHTML='hide'; |
| 89 |
} |
| 90 |
return false; |
| 91 |
} |
| 92 |
var antiRobot = 0; |
| 93 |
function antiRobotGo(){ |
| 94 |
if( antiRobot!=3 ) return; |
| 95 |
antiRobot = 7; |
| 96 |
var j = document.getElementById("mtimelink"); |
| 97 |
if(j && j.hasAttribute("data-href")) j.href=j.getAttribute("data-href"); |
| 98 |
} |
| 99 |
function antiRobotDefense(){ |
| 100 |
document.body.onmousedown=function(){ |
| 101 |
antiRobot |= 2; |
| 102 |
antiRobotGo(); |
| 103 |
document.body.onmousedown=null; |
| 104 |
} |
| 105 |
document.body.onmousemove=function(){ |
| 106 |
antiRobot |= 2; |
| 107 |
antiRobotGo(); |
| 108 |
document.body.onmousemove=null; |
| 109 |
} |
| 110 |
setTimeout(function(){ |
| 111 |
antiRobot |= 1; |
| 112 |
antiRobotGo(); |
| 113 |
}, 100) |
| 114 |
antiRobotGo(); |
| 115 |
} |
| 116 |
antiRobotDefense(); |
| 117 |
</script> |
| 118 |
<div class=fancy> |
| 119 |
<div class=nosearch> |
| 120 |
<div class="fancy_title"> |
| 121 |
How To Download Canonical SQLite Source Code |
| 122 |
</div> |
| 123 |
</div> |
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
<h1 id="introduction"><span>1. </span>Introduction</h1> |
| 130 |
|
| 131 |
<p>Most programmers compile SQLite into their applications using |
| 132 |
the <a href="amalgamation.html">amalgamation</a>. The <a href="amalgamation.html">amalgamation</a> is C-code but it is not |
| 133 |
"source code". The <a href="amalgamation.html">amalgamation</a> is generated from source code |
| 134 |
by scripts. |
| 135 |
|
| 136 |
</p><p>This document describes how to obtain the canonical source code |
| 137 |
for SQLite - the raw source files from which the amalgamation is |
| 138 |
built. See the <a href="howtocompile.html">How To Compile SQLite</a> page for additional information |
| 139 |
on what to do with the canonical source code once it is obtained. |
| 140 |
|
| 141 |
</p><h1 id="direct_downloads"><span>2. </span>Direct Downloads</h1> |
| 142 |
|
| 143 |
<p>Snapshots of official releases of SQLite source code can often |
| 144 |
be obtained directly from the <a href="download.html">download page</a> of the SQLite website. |
| 145 |
Even if the specific version desired is not listed on the download page, |
| 146 |
the naming conventions are fairly clear and so programmers can often |
| 147 |
guess the name of an historical release and download it that way. |
| 148 |
|
| 149 |
</p><h1 id="obtaining_code_directly_from_the_version_control_system"><span>3. </span>Obtaining Code Directly From the Version Control System</h1> |
| 150 |
|
| 151 |
<p>For any historical version of SQLite, the source tree can be obtained |
| 152 |
from the <a href="https://www.fossil-scm.org/">Fossil</a> version control system, |
| 153 |
either downloading a tarball or ZIP archive for a specific version, or |
| 154 |
by cloning the entire project history. |
| 155 |
|
| 156 |
</p><p>SQLite sources are maintained on three geographically dispersed |
| 157 |
servers: |
| 158 |
|
| 159 |
</p><blockquote> |
| 160 |
<a href="https://sqlite.org/src">https://sqlite.org/src</a> (Dallas)<br> |
| 161 |
<a href="https://www2.sqlite.org/src">https://www2.sqlite.org/src</a> (Newark)<br> |
| 162 |
<a href="https://www3.sqlite.org/src">https://www3.sqlite.org/src</a> (San Francisco)<br> |
| 163 |
</blockquote> |
| 164 |
|
| 165 |
<p>The documentation is maintained in separate source repositories on |
| 166 |
those same servers: |
| 167 |
|
| 168 |
</p><blockquote> |
| 169 |
<a href="https://sqlite.org/docsrc">https://sqlite.org/docsrc</a> (Dallas)<br> |
| 170 |
<a href="https://www2.sqlite.org/docsrc">https://www2.sqlite.org/docsrc</a> (Newark)<br> |
| 171 |
<a href="https://www3.sqlite.org/docsrc">https://www3.sqlite.org/docsrc</a> (San Francisco)<br> |
| 172 |
</blockquote> |
| 173 |
|
| 174 |
<p>To download a specific historical version, first locate the specific |
| 175 |
version desired by visiting the timeline page on one of these servers |
| 176 |
(for example: <a href="https://sqlite.org/src/timeline">https://sqlite.org/src/timeline</a>). If |
| 177 |
you know the approximate date of the version you want to download, you |
| 178 |
can add a query parameter like "c=YYYY-MM-DD" to the "timeline" URL to |
| 179 |
see a timeline centered on that date. For example, to see all the check-ins |
| 180 |
that occurred around August 26, 2013, visit |
| 181 |
<a href="https://sqlite.org/src/timeline?c=2013-08-26">https://sqlite.org/src/timeline?c=2013-08-26</a>. |
| 182 |
If you are looking for an official release, visit the |
| 183 |
<a href="chronology.html">chronology</a> page, click on the date to the left of the release |
| 184 |
you are looking for, and that will take you immediately to the |
| 185 |
check-in corresponding to the release. |
| 186 |
|
| 187 |
</p><p>Once you locate a specific version, click on the hyperlink for that |
| 188 |
version to see the "Check-in Information Page". |
| 189 |
Then click on either the "Tarball" link or the |
| 190 |
"ZIP archive" link to download the complete source tree. |
| 191 |
|
| 192 |
</p><h1 id="verifying_that_the_code_is_unmodified"><span>4. </span>Verifying That The Code Is Unmodified</h1> |
| 193 |
|
| 194 |
<p> |
| 195 |
The "<tt>manifest</tt>" file at the root directory of the source tree |
| 196 |
contains either a SHA3-256 hash or a SHA1 hash for every source file |
| 197 |
in the repository. The name of the version of the entire source tree |
| 198 |
is just the SHA3-256 hash of the "<tt>manifest</tt>" file itself, possibly with |
| 199 |
the last line of that file omitted if the last line begins with |
| 200 |
"# Remove this line". The "<tt>manifest.uuid</tt>" file should contain |
| 201 |
the SHA3-256 hash of the "<tt>manifest</tt>" file. If all of the above hash |
| 202 |
comparisons are correct, then you can be confident that your source |
| 203 |
tree is authentic and unadulterated. Details on the format of |
| 204 |
manifest files are available on the |
| 205 |
<a href="https://fossil-scm.org/home/doc/trunk/www/fileformat.wiki#manifest"> |
| 206 |
Fossil website</a>. |
| 207 |
|
| 208 |
</p><p> |
| 209 |
The process of checking source code authenticity is automated by the makefile: |
| 210 |
|
| 211 |
</p><div class="codeblock"><pre>make verify-source |
| 212 |
</pre></div> |
| 213 |
|
| 214 |
<p> |
| 215 |
Or on windows: |
| 216 |
|
| 217 |
</p><div class="codeblock"><pre>nmake /f Makefile.msc verify-source |
| 218 |
</pre></div> |
| 219 |
|
| 220 |
<p> |
| 221 |
Using the makefile to verify source integrity is good for detecting |
| 222 |
accidental changes to the source tree, but malicious changes could |
| 223 |
be hidden by also modifying the makefiles. |
| 224 |
|
| 225 |
<a name="clone"></a> |
| 226 |
|
| 227 |
</p><h1 id="cloning_the_complete_development_history"><span>5. </span>Cloning The Complete Development History</h1> |
| 228 |
|
| 229 |
<p>To clone the entire history of SQLite, first go to the |
| 230 |
<a href="https://www.fossil-scm.org/download.html">https://www.fossil-scm.org/download.html</a> page and grab a precompiled binary |
| 231 |
for the Fossil version control program. Or get the source code on the |
| 232 |
same page and compile it yourself. |
| 233 |
|
| 234 |
</p><p>As of 2017-03-12, you must use Fossil version |
| 235 |
2.0 or later for the following instructions to work. |
| 236 |
The SQLite repository started using |
| 237 |
artifacts named using SHA3 hashes instead of SHA1 hashes on that date, |
| 238 |
and Fossil 2.0 or later is needed in order to understand the new SHA3 |
| 239 |
hashes. To find out what version of Fossil you are running, |
| 240 |
type "fossil -v".</p> |
| 241 |
|
| 242 |
<p>Fossil is a completely stand-alone |
| 243 |
program, so install it simply by putting the "fossil" or "fossil.exe" |
| 244 |
executable someplace on your $PATH or %PATH%. After you have Fossil |
| 245 |
installed, do this: |
| 246 |
|
| 247 |
</p><div class="codeblock"><pre>fossil clone https://sqlite.org/src sqlite.fossil |
| 248 |
</pre></div> |
| 249 |
|
| 250 |
<p>The command above |
| 251 |
will make a copy of the complete development history of |
| 252 |
SQLite into the "sqlite.fossil" file on your computer. Making this copy |
| 253 |
takes about a minute and uses about 32 megabytes of transfer. After |
| 254 |
making the copy, "open" the repository by typing: |
| 255 |
|
| 256 |
</p><div class="codeblock"><pre>fossil open sqlite.fossil |
| 257 |
</pre></div> |
| 258 |
|
| 259 |
<p>This second command will "checkout" the latest check-in from the SQLite |
| 260 |
source tree into your current directory. Subsequently, you can easily switch |
| 261 |
to a different version by typing: |
| 262 |
|
| 263 |
</p><div class="codeblock"><pre>fossil update VERSION |
| 264 |
</pre></div> |
| 265 |
|
| 266 |
<p>Where VERSION can be a branch name (like "trunk" or "session") to get the |
| 267 |
latest check-in on a specific branch, or VERSION can be a SHA1 hash or a |
| 268 |
prefix of a SHA1 hash for a specific check-in, or VERSION can be a tag |
| 269 |
such as "version-3.8.8". Every time you run "fossil update" it will |
| 270 |
automatically reach out to the original repository at |
| 271 |
https://sqlite.org/src to obtain new check-ins that might have been |
| 272 |
made by others since your previous update. |
| 273 |
</p><p align="center"><small><i>This page was last updated on 2025-04-16 13:13:29Z </small></i></p> |
| 274 |
|