This repository contains the complete source code for the SQLite database engine. Some test scripts are also included. However, many other test scripts and most of the documentation are managed separately.
SQLite sources are managed using Fossil, a distributed version control system that was specifically designed and written to support SQLite development. The Fossil repository contains the urtext.
If you are reading this on GitHub or some other Git repository or service,
then you are looking at a mirror. The names of check-ins and
other artifacts in a Git mirror are different from the official
names for those objects. The official names for check-ins are
found in a footer on the check-in comment for authorized mirrors.
The official check-in name can also be seen in the manifest.uuid file
in the root of the tree. Always use the official name, not the
Git-name, when communicating about an SQLite check-in.
If you pulled your SQLite source code from a secondary source and want to verify its integrity, there are hints on how to do that in the Verifying Code Authenticity section below.
The preferred way to ask questions or make comments about SQLite or to report bugs against SQLite is to visit the SQLite Forum at https://sqlite.org/forum/. Anonymous postings are permitted.
If you think you have found a bug that has security implications and you do not want to report it on the public forum, you can send a private email to drh at sqlite dot org.
The SQLite source code is in the public domain. See https://sqlite.org/copyright.html for details.
Because SQLite is in the public domain, we do not normally accept pull requests, because if we did take a pull request, the changes in that pull request might carry a copyright and the SQLite source code would then no longer be fully in the public domain.
If you do not want to use Fossil, you can download tarballs or ZIP archives or SQLite archives as follows:
-
Latest trunk check-in as Tarball, ZIP-archive, or SQLite-archive.
-
Latest release as Tarball, ZIP-archive, or SQLite-archive.
-
For other check-ins, substitute an appropriate branch name or tag or hash prefix in place of "release" in the URLs of the previous bullet. Or browse the timeline to locate the check-in desired, click on its information page link, then click on the "Tarball" or "ZIP Archive" links on the information page.
If you do want to use Fossil to check out the source tree, first install Fossil version 2.0 or later. (Source tarballs and precompiled binaries available here. Fossil is a stand-alone program. To install, simply download or build the single executable file and put that file someplace on your $PATH.) Then run commands like this:
mkdir -p ~/sqlite ~/Fossils
cd ~/sqlite
fossil clone https://www.sqlite.org/src ~/Fossils/sqlite.fossil
fossil open ~/Fossils/sqlite.fossil
After setting up a repository using the steps above, you can always update to the latest version using:
fossil update trunk ;# latest trunk check-in
fossil update release ;# latest official release
Or type "fossil ui" to get a web-based user interface.
First create a directory in which to place the build products. It is recommended, but not required, that the build directory be separate from the source directory. Cd into the build directory and then from the build directory run the configure script found at the root of the source tree. Then run "make".
For example:
tar xzf sqlite.tar.gz ;# Unpack the source tree into "sqlite"
mkdir bld ;# Build will occur in a sibling directory
cd bld ;# Change to the build directory
../sqlite/configure ;# Run the configure script
make ;# Builds the "sqlite3" command-line tool
make sqlite3.c ;# Build the "amalgamation" source file
make devtest ;# Run some tests (requires Tcl)
See the makefile for additional targets.
The configure script uses autoconf 2.61 and libtool. If the configure script does not work out for you, there is a generic makefile named "Makefile.linux-gcc" in the top directory of the source tree that you can copy and edit to suit your needs. Comments on the generic makefile show what changes are needed.
On Windows, all applicable build products can be compiled with MSVC. You will also need a working installation of TCL. See the compile-for-windows.md document for additional information about how to install MSVC and TCL and configure your build environment.
If you want to run tests, you need to let SQLite know the location of your TCL library, using a command like this:
set TCLDIR=c:\Tcl
SQLite uses "tclsh.exe" as part of the build process, and so that utility program will need to be somewhere on your %PATH%. The finished SQLite library does not contain any TCL code, but it does use TCL to help with the build process and to run tests.
Build using Makefile.msc. Example:
nmake /f Makefile.msc
nmake /f Makefile.msc sqlite3.c
nmake /f Makefile.msc devtest
nmake /f Makefile.msc releasetest
There are many other makefile targets. See comments in Makefile.msc for details.
< 8000 div class="markdown-heading" dir="auto">