# # Run this TCL script to generate HTML for the index.html file. # set rcsid {$Id: index.tcl,v 1.29 2000/09/30 22:46:07 drh Exp $} puts { SQLite: An SQL Database Library Built Atop GDBM

SQLite: An SQL Database Library Built Atop GDBM

} puts "This page was last modified on [lrange $rcsid 3 4] GMT
" set vers [lindex $argv 0] puts "The latest SQLite version is $vers" puts " created on [exec cat last_change] GMT" puts {

} puts {

Introduction

SQLite is an SQL database library (libsqlite.a) that uses GDBM as its underlying file storage mechanism. Programs that link the SQLite library can have SQL database access without running a separate RDBMS process. The distribution comes with a standalone command-line access program (sqlite) that can be used to administer an SQLite database and which serves as an example of how to use the SQLite library.

Features

Current Status

A change history is available online. There are currently no known bugs or memory leaks in the library. Gcov is used to verify test coverage. The test suite currently exercises all code except for a few areas which are unreachable or which are only reached when malloc() fails. The code has been tested for memory leaks and is found to be clean.

Among the SQL features that SQLite does not currently implement are:

Important News Flash!

The SQLite file format was changed in an incompatible way on Aug 2, 2000. If you are updated the library and have databases built using the old version of the library, you should save your old databases into an ASCII file then reimport the database using the new library. For example, if you change the name of the old sqlite utility to "old-sqlite" and change the name of the old database directory to "old-db", then you can reconstruct the database as follows:

echo .dump | old-sqlite old-db | sqlite db

This file format change was made to work around a potential inefficiency in GDBM that comes up when large indices are created on tables where many entries in the table have the same index key.

Documentation

The following documentation is currently available:

The SQLite source code is 35% comment. These comments are another important source of information.

} puts {

Mailing List

A mailing list has been set up on eGroups for discussion of SQLite design issues or for asking questions about SQLite.


Click to subscribe to sqlite
} puts {

Download

You can download a tarball containing all source code for SQLite } puts "version $vers" puts { (including the TCL scripts that generate the HTML files for this website) at sqlite.tar.gz.} puts "This is a [file size sqlite.tar.gz] byte download." puts {

To build sqlite under Unix, just unwrap the tarball, create a separate build directory, run configure from the build directory and then type "make". For example:

$ tar xzf sqlite.tar.gz       Unpacks into directory named "sqlite" 
$ mkdir bld                   Create a separate build directory 
$ cd bld
$ ../sqlite/configure
$ make                        Builds "sqlite" and "libsqlite.a" 
$ make test                   Optional: run regression tests 

Instructions for building SQLite for WindowsNT are found here. } puts {

Command-line Usage Example

Download the source archive and compile the sqlite program as described above. The type:

bash$ sqlite ~/newdb              Directory ~/newdb created automatically
sqlite> create table t1(
   ...>    a int,
   ...>    b varchar(20)
   ...>    c text
   ...> );                        End each SQL statement with a ';'
sqlite> insert into t1
   ...> values(1,'hi','y''all');
sqlite> select * from t1;
1|hello|world
sqlite> .mode columns             Special commands begin with '.'
sqlite> .header on                Type ".help" for a list of commands
sqlite> select * from t1;
a      b       c
------ ------- -------
1      hi      y'all
sqlite> .exit
base$
} puts {

Related Sites

} puts {


More Open Source Software from Hwaci.

}