2000-05-29 21:44:25 +04:00
|
|
|
#
|
|
|
|
# Run this TCL script to generate HTML for the index.html file.
|
|
|
|
#
|
2001-10-06 20:33:02 +04:00
|
|
|
set rcsid {$Id: index.tcl,v 1.44 2001/10/06 16:33:04 drh Exp $}
|
2000-05-29 21:44:25 +04:00
|
|
|
|
|
|
|
puts {<html>
|
2001-09-20 05:44:42 +04:00
|
|
|
<head><title>SQLite: An SQL Database Engine In A C Library</title></head>
|
2000-05-29 21:44:25 +04:00
|
|
|
<body bgcolor=white>
|
2001-09-20 05:44:42 +04:00
|
|
|
<h1 align=center>SQLite: An SQL Database Engine In A C Library</h1>
|
2000-05-29 21:44:25 +04:00
|
|
|
<p align=center>}
|
2000-06-02 17:27:59 +04:00
|
|
|
puts "This page was last modified on [lrange $rcsid 3 4] GMT<br>"
|
2000-08-17 14:22:34 +04:00
|
|
|
set vers [lindex $argv 0]
|
|
|
|
puts "The latest SQLite version is <b>$vers</b>"
|
|
|
|
puts " created on [exec cat last_change] GMT"
|
2000-05-29 21:44:25 +04:00
|
|
|
puts {</p>}
|
|
|
|
|
|
|
|
puts {<h2>Introduction</h2>
|
|
|
|
|
2001-09-16 04:13:26 +04:00
|
|
|
<p>SQLite is a C library that implements an SQL database engine.
|
|
|
|
Programs that link with the SQLite library can have SQL database
|
2000-08-18 13:58:51 +04:00
|
|
|
access without running a separate RDBMS process.
|
|
|
|
The distribution comes with a standalone command-line
|
|
|
|
access program (<a href="sqlite.html">sqlite</a>) that can
|
|
|
|
be used to administer an SQLite database and which serves as
|
|
|
|
an example of how to use the SQLite library.</p>
|
2000-06-08 23:38:36 +04:00
|
|
|
|
2001-09-20 05:44:42 +04:00
|
|
|
<p>SQLite is <b>not</b> a client library used to connect to a
|
|
|
|
big database server. SQLite <b>is</b> the server. The SQLite
|
|
|
|
library reads and writes directly to and from the database files
|
2001-09-28 21:47:14 +04:00
|
|
|
on disk.</p>}
|
2000-08-02 16:26:28 +04:00
|
|
|
|
2001-09-28 21:47:14 +04:00
|
|
|
puts {<table align="right"hspace="10">
|
|
|
|
<tr><td align="center" bgcolor="#8ee5ee">
|
|
|
|
<table border="2"><tr><td align="center">
|
|
|
|
<a href="download.html"><big><b>Download<br>SQLite
|
|
|
|
</td></tr></table>
|
|
|
|
</td></tr>
|
|
|
|
</table>}
|
|
|
|
|
|
|
|
puts {<h2>Features</h2>
|
2000-06-08 23:38:36 +04:00
|
|
|
|
|
|
|
<p><ul>
|
2001-09-16 04:13:26 +04:00
|
|
|
<li>Implements a large subset of SQL92.</li>
|
2001-09-29 03:11:24 +04:00
|
|
|
<li>A complete database (with multiple tables and indices) is
|
2001-09-16 04:13:26 +04:00
|
|
|
stored in a single disk file.</li>
|
|
|
|
<li>Atomic commit and rollback protect data integrity.</li>
|
|
|
|
<li>Small memory footprint: about 12000 lines of C code.</li>
|
2001-09-25 05:50:59 +04:00
|
|
|
<li><a href="speed.html">Four times faster</a> than PostgreSQL.
|
|
|
|
Twice as fast as SQLite 1.0.</li>
|
2000-06-08 23:38:36 +04:00
|
|
|
<li>Very simple
|
2000-07-28 18:32:48 +04:00
|
|
|
<a href="c_interface.html">C/C++ interface</a> requires the use of only
|
|
|
|
three functions and one opaque structure.</li>
|
2001-09-29 03:11:24 +04:00
|
|
|
<li><a href="tclsqlite.html">TCL bindings</a> included.</li>
|
2001-09-16 04:13:26 +04:00
|
|
|
<li>A TCL-based test suite provides near 100% code coverage.</li>
|
|
|
|
<li>Self-contained: no external dependencies.</li>
|
2001-09-20 05:44:42 +04:00
|
|
|
<li>Built and tested under Linux and Win2K.</li>
|
2001-09-20 16:32:53 +04:00
|
|
|
<li>Sources are uncopyrighted. Use for any purpose.</li>
|
2000-06-08 23:38:36 +04:00
|
|
|
</ul>
|
|
|
|
</p>
|
2001-09-20 05:44:42 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
puts {<h2>Current Status</h2>
|
2000-06-08 23:38:36 +04:00
|
|
|
|
|
|
|
<p>A <a href="changes.html">change history</a> is available online.
|
2001-09-29 03:11:24 +04:00
|
|
|
The latest source code is
|
|
|
|
<a href="download.html">available for download</a>.
|
2001-04-05 20:49:44 +04:00
|
|
|
There are currently no <em>known</em> memory leaks or debilitating bugs
|
2001-09-29 03:11:24 +04:00
|
|
|
in the library.
|
|
|
|
</p>
|
2001-04-05 20:49:44 +04:00
|
|
|
|
2001-09-29 03:11:24 +04:00
|
|
|
<p>
|
|
|
|
The file format used changed beginning with version 2.0.0. Version 1.0.X
|
|
|
|
of SQLite used GDBM as its database backend. Version 2.0.0 and later
|
|
|
|
use a built-in implementation of B-trees. If you have older 1.0 databases
|
|
|
|
you will need to convert them before they can be read using a 2.0
|
|
|
|
release of SQLite. The following command will convert a legacy
|
|
|
|
database into the new 2.0 format:
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<blockquote><pre>
|
|
|
|
echo .dump | sqlite1.0 old.db | sqlite2.0 new.db
|
|
|
|
</pre></blockquote>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
The above command assumes that <b>sqlite1.0</b> is sqlite version 1.0
|
|
|
|
and <b>sqlite2.0</b> is sqlite version 2.0. The old database is stored
|
|
|
|
in a directory named <b>old.db</b> and the new database is created in
|
|
|
|
the file <b>new.db</b>.
|
|
|
|
</p>
|
2000-06-08 23:38:36 +04:00
|
|
|
|
|
|
|
<h2>Documentation</h2>
|
2000-05-29 21:44:25 +04:00
|
|
|
|
2000-06-08 23:38:36 +04:00
|
|
|
<p>The following documentation is currently available:</p>
|
2000-05-29 21:44:25 +04:00
|
|
|
|
2000-06-08 23:38:36 +04:00
|
|
|
<p><ul>
|
|
|
|
<li>Information on the <a href="sqlite.html">sqlite</a>
|
|
|
|
command-line utility.</li>
|
2000-06-09 18:14:32 +04:00
|
|
|
<li>The <a href="lang.html">SQL Language</a> subset understood by SQLite.</li>
|
2000-06-08 23:38:36 +04:00
|
|
|
<li>The <a href="c_interface.html">C/C++ Interface</a>.</li>
|
2001-09-29 03:11:24 +04:00
|
|
|
<li>The <a href="tclsqlite.html">Tcl Binding</a> to SQLite.</li>
|
2000-06-09 07:47:19 +04:00
|
|
|
<li>The <a href="arch.html">Architecture of the SQLite Library</a> describes
|
2000-06-09 18:14:32 +04:00
|
|
|
how the library is put together.</li>
|
2000-06-09 07:51:26 +04:00
|
|
|
<li>A description of the <a href="opcode.html">virtual machine</a> that
|
2000-06-09 18:14:32 +04:00
|
|
|
SQLite uses to access the database.</li>
|
2000-06-08 23:38:36 +04:00
|
|
|
</ul>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>The SQLite source code is 35% comment. These comments are
|
|
|
|
another important source of information. </p>
|
2000-05-29 21:44:25 +04:00
|
|
|
}
|
|
|
|
|
2000-05-29 22:50:16 +04:00
|
|
|
puts {
|
2001-09-20 05:44:42 +04:00
|
|
|
<table align="right">
|
|
|
|
<tr><td align="center">
|
|
|
|
<a href="http://www.yahoogroups.com/subscribe/sqlite">
|
|
|
|
<img src="http://www.egroups.com/img/ui/join.gif" border=0 /><br />
|
|
|
|
Click to subscribe to sqlite</a>
|
|
|
|
</td></tr>
|
|
|
|
</table>
|
2000-05-29 22:50:16 +04:00
|
|
|
<a name="mailinglist" />
|
|
|
|
<h2>Mailing List</h2>
|
2001-09-20 05:44:42 +04:00
|
|
|
<p>A mailing list has been set up on yahooGroups for discussion of
|
2000-05-29 21:44:25 +04:00
|
|
|
SQLite design issues or for asking questions about SQLite.</p>
|
2001-09-20 05:44:42 +04:00
|
|
|
}
|
2000-05-29 21:44:25 +04:00
|
|
|
|
2001-09-20 05:44:42 +04:00
|
|
|
puts {<h2>Building From Source</h2>}
|
2000-05-29 21:44:25 +04:00
|
|
|
|
2000-08-17 14:22:34 +04:00
|
|
|
puts {
|
2000-08-04 17:49:02 +04:00
|
|
|
<p>To build sqlite under Unix, just unwrap the tarball, create a separate
|
2000-06-02 17:27:59 +04:00
|
|
|
build directory, run configure from the build directory and then
|
|
|
|
type "make". For example:</p>
|
|
|
|
|
|
|
|
<blockquote><pre>
|
2000-06-08 23:38:36 +04:00
|
|
|
$ tar xzf sqlite.tar.gz <i> Unpacks into directory named "sqlite" </i>
|
|
|
|
$ mkdir bld <i> Create a separate build directory </i>
|
2000-06-02 17:27:59 +04:00
|
|
|
$ cd bld
|
|
|
|
$ ../sqlite/configure
|
2000-06-08 23:38:36 +04:00
|
|
|
$ make <i> Builds "sqlite" and "libsqlite.a" </i>
|
|
|
|
$ make test <i> Optional: run regression tests </i>
|
2000-06-02 17:27:59 +04:00
|
|
|
</pre></blockquote>
|
2000-06-03 23:28:48 +04:00
|
|
|
}
|
2000-05-29 21:44:25 +04:00
|
|
|
|
2000-06-08 23:38:36 +04:00
|
|
|
puts {<h2>Command-line Usage Example</h2>
|
|
|
|
|
|
|
|
<p>Download the source archive and compile the <b>sqlite</b>
|
2001-05-21 17:45:10 +04:00
|
|
|
program as described above. Then type:</p>
|
2000-06-08 23:38:36 +04:00
|
|
|
|
|
|
|
<blockquote><pre>
|
|
|
|
bash$ sqlite ~/newdb <i>Directory ~/newdb created automatically</i>
|
|
|
|
sqlite> create table t1(
|
|
|
|
...> a int,
|
|
|
|
...> b varchar(20)
|
|
|
|
...> c text
|
|
|
|
...> ); <i>End each SQL statement with a ';'</i>
|
|
|
|
sqlite> insert into t1
|
|
|
|
...> values(1,'hi','y''all');
|
|
|
|
sqlite> select * from t1;
|
|
|
|
1|hello|world
|
|
|
|
sqlite> .mode columns <i>Special commands begin with '.'</i>
|
|
|
|
sqlite> .header on <i>Type ".help" for a list of commands</i>
|
|
|
|
sqlite> select * from t1;
|
|
|
|
a b c
|
|
|
|
------ ------- -------
|
|
|
|
1 hi y'all
|
|
|
|
sqlite> .exit
|
|
|
|
base$
|
|
|
|
</pre></blockquote>
|
|
|
|
}
|
2000-05-29 21:44:25 +04:00
|
|
|
puts {<h2>Related Sites</h2>
|
|
|
|
|
|
|
|
<ul>
|
2000-06-01 00:00:52 +04:00
|
|
|
|
2001-10-06 20:33:02 +04:00
|
|
|
<li><p>An ODBC driver for SQLite can be found at
|
|
|
|
<a href="http://www.ch-werner.de/sqliteodbc/">
|
|
|
|
http://www.ch-werner.de/sqliteodbc/</a>.</p></li>
|
|
|
|
|
2000-06-02 17:27:59 +04:00
|
|
|
<li><p>Here is a good <a href="http://w3.one.net/~jhoffman/sqltut.htm">
|
2000-06-01 00:00:52 +04:00
|
|
|
tutorial on SQL</a>.</p></li>
|
2000-06-02 17:27:59 +04:00
|
|
|
|
|
|
|
<li><p><a href="http://www.postgresql.org/">PostgreSQL</a> is a
|
|
|
|
full-blown SQL RDBMS that is also open source.</p></li>
|
2000-06-02 19:51:18 +04:00
|
|
|
|
|
|
|
<li><p><a href="http://www.chordate.com/gadfly.html">Gadfly</a> is another
|
|
|
|
SQL library, similar to SQLite, except that Gadfly is written
|
|
|
|
in Python.</p></li>
|
2000-05-29 21:44:25 +04:00
|
|
|
</ul>}
|
|
|
|
|
|
|
|
puts {
|
|
|
|
<p><hr /></p>
|
|
|
|
<p>
|
|
|
|
<a href="../index.html"><img src="/goback.jpg" border=0 />
|
|
|
|
More Open Source Software</a> from Hwaci.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</body></html>}
|