]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Documentation updates. (CVS 275)
authordrh <drh@noemail.net>
Fri, 28 Sep 2001 23:11:24 +0000 (23:11 +0000)
committerdrh <drh@noemail.net>
Fri, 28 Sep 2001 23:11:24 +0000 (23:11 +0000)
FossilOrigin-Name: 4b4bfc6290f05c6672338690911f68fd8bb418c9

manifest
manifest.uuid
www/arch.tcl
www/c_interface.tcl
www/index.tcl
www/opcode.tcl
www/speed.tcl
www/sqlite.tcl
www/vdbe.tcl

index af6cd78425d3589cfbd3bf2e3345e425ad58286b..a32ea08427f655bfde618e86dcc2202d34f85417 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Remove\sreference\sto\sGDBM\sin\sthe\sdocumentation\sof\sthe\s"sqlite"\ncommand-line\sutility.\s(CVS\s274)
-D 2001-09-28T18:14:17
+C Documentation\supdates.\s(CVS\s275)
+D 2001-09-28T23:11:24
 F Makefile.in 98d4627cb364537e4c3a29ee806171f3abf5211a
 F Makefile.template 7179523fdf3d6e7933ec843e2352dcfc9785c700
 F README 93d2977cc5c6595c448de16bdefc312b9d401533
@@ -98,20 +98,20 @@ F tool/renumberOps.awk 6d067177ad5f8d711b79577b462da9b3634bd0a9
 F tool/report1.txt 9eae07f26a8fc53889b45fc833a66a33daa22816
 F www/arch.fig d5f9752a4dbf242e9cfffffd3f5762b6c63b3bcf
 F www/arch.png 82ef36db1143828a7abc88b1e308a5f55d4336f4
-F www/arch.tcl c1891efdc00cd76eec72bdbf8b446195902932a3
-F www/c_interface.tcl 52ae81c89bf906b358e04857bd3f76b1a7f61c1b
+F www/arch.tcl 03b521d252575f93b9c52f7c8b0007011512fcfb
+F www/c_interface.tcl 8e8d9e66e8467c5751116c3427296bde77f474a6
 F www/changes.tcl 47619693c843174b57d41482fcd00e2e70d41fd0
 F www/crosscompile.tcl c99efacb3aefaa550c6e80d91b240f55eb9fd33e
 F www/dynload.tcl 02eb8273aa78cfa9070dd4501dca937fb22b466c
-F www/index.tcl 639a75165dc532a16ddb02055bc69541eecc3fa7
+F www/index.tcl 998f61fe69be9f1b04e403c8efb75bca92710e83
 F www/lang.tcl 33a74d727615ccbee8be7c8efd5876ce008c4b0e
 F www/mingw.tcl fc5f4ba9d336b6e8c97347cc6496d6162461ef60
-F www/opcode.tcl 60222aeb57a7855b2582c374b8753cb5bb53c4ab
-F www/speed.tcl 91b53f9403a62bb322dc1f85a81531309bcfb41c
-F www/sqlite.tcl ea362207eee32cdd9dd594b1ec990bdb20101efe
+F www/opcode.tcl 4365ad9798872491dbd7d3071510ebe461785ac3
+F www/speed.tcl ab7d6d3bc898472bd94320a5d3c63de928d4804b
+F www/sqlite.tcl 6a21242a272e9c0939a04419a51c3d50cae33e3e
 F www/tclsqlite.tcl 13d50723f583888fc80ae1a38247c0ab415066fa
-F www/vdbe.tcl 0c8aaa529dd216ccbf7daaabd80985e413d5f9ad
-P 7e79e91b03e21058bbae2c0aab8f3e8ce09ae7f9
-R 241095ce4074dd39044429d0144b987e
+F www/vdbe.tcl bb7d620995f0a987293e9d4fb6185a3b077e9b44
+P 0ffab36d1fc29125fdcf0d732073f77012dfcad4
+R 50ffde789836ed27912ab4a11f3cd02b
 U drh
-Z 5497d3942cad9d16c737ee62c27c8636
+Z 7f4c737cc5ad90cbc1518651f459aab9
index e2aae0032c88cb8523c875a029b4758594f192cc..a41dbd5389239a90423abca6ec00abe6d01501c6 100644 (file)
@@ -1 +1 @@
-0ffab36d1fc29125fdcf0d732073f77012dfcad4
\ No newline at end of file
+4b4bfc6290f05c6672338690911f68fd8bb418c9
\ No newline at end of file
index 0982b7dee5e0af57a3b30b01c45a55837639c246..a32f9f592ec0446e56bf2a047419ceff5ff747af 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Run this Tcl script to generate the sqlite.html file.
 #
-set rcsid {$Id: arch.tcl,v 1.5 2001/09/20 01:44:43 drh Exp $}
+set rcsid {$Id: arch.tcl,v 1.6 2001/09/28 23:11:24 drh Exp $}
 
 puts {<html>
 <head>
@@ -121,11 +121,11 @@ between the virtual machine and the rest of the SQLite library.</p>
 
 <p>An SQLite database is maintained on disk using a B-tree implementation
 found in the <b>btree.c</b> source file.  A separate B-tree is used for
-each table and index in the database but all B-trees are stored in the
-same disk file.  Each page of a B-tree is 1024 bytes in size.  The data
-is stored with the key in an area called "payload".  Up to 236 bytes of
-payload can be stored with each B-tree entry.  Any additional payload
-is stored in a chain of overflow pages.</p>
+each table and index in the database.  All B-trees are stored in the
+same disk file.  Each page of a B-tree is 1024 bytes in size.  The key
+and data for an entry are stored together in an area called "payload".
+Up to 236 bytes of payload can be stored on the same page as the B-tree
+entry.  Any additional payload is stored in a chain of overflow pages.</p>
 
 <p>The interface to the B-tree subsystem is defined by the header file
 <b>btree.h</b>.
@@ -135,11 +135,11 @@ is stored in a chain of overflow pages.</p>
 
 <p>The B-tree module requests information from the disk in 1024 byte
 chunks.  The page cache is reponsible for reading, writing, and
-caching these chunks for the B-tree module.
+caching these chunks at the behest of the B-tree module.
 The page cache also provides the rollback and atomic commit abstraction
 and takes care of reader/writer locking of the database file.  The
 B-tree driver requests particular pages from the page cache and notifies
-the page cache when it wants to modify pages and commit or rollback its
+the page cache when it wants to modify pages or commit or rollback
 changes and the page cache handles all the messy details of making sure
 the requests are handled quickly, safely, and efficiently.</p>
 
index fdbd668fb9e067ac8a442253a72f54e8c63fbdf8..c65f5891883d96ee2f8c47c09b299b4dbcb845b1 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Run this Tcl script to generate the sqlite.html file.
 #
-set rcsid {$Id: c_interface.tcl,v 1.15 2001/09/20 01:44:43 drh Exp $}
+set rcsid {$Id: c_interface.tcl,v 1.16 2001/09/28 23:11:24 drh Exp $}
 
 puts {<html>
 <head>
@@ -41,22 +41,26 @@ int sqlite_exec(
   char **errmsg
 );
 
-#define SQLITE_OK        0    /* Successful result */
-#define SQLITE_ERROR     1    /* SQL error or missing database */
-#define SQLITE_INTERNAL  2    /* An internal logic error in SQLite */
-#define SQLITE_PERM      3    /* Access permission denied */
-#define SQLITE_ABORT     4    /* Callback routine requested an abort */
-#define SQLITE_BUSY      5    /* One or more database files are locked */
-#define SQLITE_NOMEM     6    /* A malloc() failed */
-#define SQLITE_READONLY  7    /* Attempt to write a readonly database */
-#define SQLITE_INTERRUPT 8    /* Operation terminated by sqlite_interrupt() */
-#define SQLITE_IOERR     9    /* Some kind of disk I/O error occurred */
-#define SQLITE_CORRUPT   10   /* The database disk image is malformed */
-#define SQLITE_FULL      12   /* Insertion failed because database is full */
-#define SQLITE_CANTOPEN  13   /* Unable to open the database file */
-#define SQLITE_PROTOCOL  14   /* Database lock protocol error */
-#define SQLITE_SCHEMA    16   /* The database schema changed */
-#define SQLITE_TOOBIG    17   /* Too much data for one row of a table */
+#define SQLITE_OK           0   /* Successful result */
+#define SQLITE_ERROR        1   /* SQL error or missing database */
+#define SQLITE_INTERNAL     2   /* An internal logic error in SQLite */
+#define SQLITE_PERM         3   /* Access permission denied */
+#define SQLITE_ABORT        4   /* Callback routine requested an abort */
+#define SQLITE_BUSY         5   /* The database file is locked */
+#define SQLITE_LOCKED       6   /* A table in the database is locked */
+#define SQLITE_NOMEM        7   /* A malloc() failed */
+#define SQLITE_READONLY     8   /* Attempt to write a readonly database */
+#define SQLITE_INTERRUPT    9   /* Operation terminated by sqlite_interrupt() */
+#define SQLITE_IOERR       10   /* Some kind of disk I/O error occurred */
+#define SQLITE_CORRUPT     11   /* The database disk image is malformed */
+#define SQLITE_NOTFOUND    12   /* (Internal Only) Table or record not found */
+#define SQLITE_FULL        13   /* Insertion failed because database is full */
+#define SQLITE_CANTOPEN    14   /* Unable to open the database file */
+#define SQLITE_PROTOCOL    15   /* Database lock protocol error */
+#define SQLITE_EMPTY       16   /* (Internal Only) Database table is empty */
+#define SQLITE_SCHEMA      17   /* The database schema changed */
+#define SQLITE_TOOBIG      18   /* Too much data for one row of a table */
+#define SQLITE_CONSTRAINT  19   /* Abort due to contraint violation */
 </pre></blockquote>
 
 <p>Only the three core routines shown above are required to use
@@ -259,6 +263,15 @@ database at the same time, but only one thread can have the database
 open for writing at the same time.  Locking in SQLite is on the
 entire database.</p>
 </p></dd>
+<dt>SQLITE_LOCKED</dt>
+<dd><p>This return code is similar to SQLITE_BUSY in that it indicates
+that the database is locked.  But the source of the lock is a recursive
+call to <b>sqlite_exec()</b>.  This return can only occur if you attempt
+to invoke sqlite_exec() from within a callback routine of a query
+from a prior invocation of sqlite_exec().  Recursive calls to
+sqlite_exec() are allowed as long as no more they all read-only or do
+not attempt to write the same table.
+</p></dd>
 <dt>SQLITE_NOMEM</dt>
 <dd><p>This value is returned if a call to <b>malloc()</b> fails.
 </p></dd>
@@ -309,6 +322,10 @@ command usually will clear the problem.
 of a single table.  If you attempt to store more than 64K in a single
 row, this is the return code you get.
 </p></dd>
+<dt>SQLITE_CONSTRAINT</dt>
+<dd><p>This constant is returned if the SQL statement would have violated
+a database constraint.
+</p></dd>
 </dl>
 </blockquote>
 
index 23c4af1590f2be38d43d121d6b4b898770e67b7d..3abbdaad81dc6013d972f1eb31bb78612019fa1f 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Run this TCL script to generate HTML for the index.html file.
 #
-set rcsid {$Id: index.tcl,v 1.42 2001/09/28 17:47:14 drh Exp $}
+set rcsid {$Id: index.tcl,v 1.43 2001/09/28 23:11:24 drh Exp $}
 
 puts {<html>
 <head><title>SQLite: An SQL Database Engine In A C Library</title></head>
@@ -41,7 +41,7 @@ puts {<h2>Features</h2>
 
 <p><ul>
 <li>Implements a large subset of SQL92.</li>
-<li>A complete SQL database (with multiple tables and indices) is
+<li>A complete database (with multiple tables and indices) is
     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>
@@ -50,8 +50,7 @@ puts {<h2>Features</h2>
 <li>Very simple 
 <a href="c_interface.html">C/C++ interface</a> requires the use of only
 three functions and one opaque structure.</li>
-<li>A <a href="tclsqlite.html">TCL interface</a>
-    to the library is included.</li>
+<li><a href="tclsqlite.html">TCL bindings</a> included.</li>
 <li>A TCL-based test suite provides near 100% code coverage.</li>
 <li>Self-contained: no external dependencies.</li>
 <li>Built and tested under Linux and Win2K.</li>
@@ -60,21 +59,34 @@ three functions and one opaque structure.</li>
 </p>
 }
 
-puts {<h2>Download</h2>
-
-<p>
-Precompiled binaries for Linux and Windows and the complete
-source tree are available for <a href="download.html">download</a>.
-</p>
-}
-
 puts {<h2>Current Status</h2>
 
 <p>A <a href="changes.html">change history</a> is available online.
+The latest source code is
+<a href="download.html">available for download</a>.
 There are currently no <em>known</em> memory leaks or debilitating bugs
-in the library.  <a href="http://gcc.gnu.org/onlinedocs/gcov_1.html">Gcov</a>
-is used to verify test coverage.</p>
+in the library.
+</p>
+
+<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>
 
 <h2>Documentation</h2>
 
@@ -85,7 +97,7 @@ is used to verify test coverage.</p>
     command-line utility.</li>
 <li>The <a href="lang.html">SQL Language</a> subset understood by SQLite.</li>
 <li>The <a href="c_interface.html">C/C++ Interface</a>.</li>
-<li>The <a href="tclsqlite.html">Tcl Interface</a>.</li>
+<li>The <a href="tclsqlite.html">Tcl Binding</a> to SQLite.</li>
 <li>The <a href="arch.html">Architecture of the SQLite Library</a> describes
     how the library is put together.</li>
 <li>A description of the <a href="opcode.html">virtual machine</a> that
index 4e16b69e191ef22826a40730eb9ca623ba5635fd..e85f542bf2f7b1f20b13818cae9fc6098432277c 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Run this Tcl script to generate the sqlite.html file.
 #
-set rcsid {$Id: opcode.tcl,v 1.5 2001/09/20 01:44:44 drh Exp $}
+set rcsid {$Id: opcode.tcl,v 1.6 2001/09/28 23:11:24 drh Exp $}
 
 puts {<html>
 <head>
@@ -183,27 +183,26 @@ sqlite> (((explain delete from tbl1 where two<20;)))
 addr  opcode        p1     p2     p3                                      
 ----  ------------  -----  -----  ----------------------------------------
 0     Transaction   0      0                                              
-1     VerifyCookie  990    0                                              
+1     VerifyCookie  219    0                                              
 2     ListOpen      0      0                                              
-3     Open          0      31     tbl1                                    
-4     VerifyCookie  990    0                                              
-5     Rewind        0      0                                              
-6     Next          0      13                                             
-7     Column        0      1                                              
-8     Integer       20     0                                              
-9     Ge            0      6                                              
-10    Recno         0      0                                              
-11    ListWrite     0      0                                              
-12    Goto          0      6                                              
-13    Close         0      0                                              
-14    ListRewind    0      0                                              
-15    Open          0      31                                             
-16    ListRead      0      20                                             
-17    MoveTo        0      0                                              
-18    Delete        0      0                                              
-19    Goto          0      16                                             
-20    ListClose     0      0                                              
-21    Commit        0      0                                              
+3     Open          0      3      tbl1                                    
+4     Rewind        0      0                                              
+5     Next          0      12                                             
+6     Column        0      1                                              
+7     Integer       20     0                                              
+8     Ge            0      5                                              
+9     Recno         0      0                                              
+10    ListWrite     0      0                                              
+11    Goto          0      5                                              
+12    Close         0      0                                              
+13    ListRewind    0      0                                              
+14    OpenWrite     0      3                                              
+15    ListRead      0      19                                             
+16    MoveTo        0      0                                              
+17    Delete        0      0                                              
+18    Goto          0      15                                             
+19    ListClose     0      0                                              
+20    Commit        0      0                                              
 }
 
 puts {
index 40a20ac9cd6664a7f6b155fe2f61f78c8d540f92..a7d81d758924d4da9aa291e98d323528a27df524 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Run this Tcl script to generate the speed.html file.
 #
-set rcsid {$Id: speed.tcl,v 1.2 2001/09/25 02:04:29 drh Exp $ }
+set rcsid {$Id: speed.tcl,v 1.3 2001/09/28 23:11:24 drh Exp $ }
 
 puts {<html>
 <head>
@@ -29,7 +29,7 @@ conclusions drawn from these experiments:
   SQLite 2.0 is significantly faster than both SQLite 1.0 and PostgreSQL
   for most common operations.
   SQLite 2.0 is over 4 times faster than PostgreSQL for simple
-  query operations about 7 times faster for <b>INSERT</b> statements 
+  query operations and about 7 times faster for <b>INSERT</b> statements 
   within a transaction.
 </p></li>
 <li><p>
@@ -75,8 +75,7 @@ the NDEBUG macro makes SQLite 2.0 run nearly twice as fast.
 
 <p>
 All tests are conducted on an otherwise quiescent machine.
-A simple shell script generates and runs all the tests.
-The shell script is named <a href="speedtest3.sh">speedtest3.sh</a>.
+A simple shell script was used to generate and run all the tests.
 Each test reports three different times:
 </p>
 
index 583a01f685fa89254b94ab9b92645fa4c1d0c3ac..d8a23af3ed498ba407b8b6284b1ebdf2c5df2770 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Run this Tcl script to generate the sqlite.html file.
 #
-set rcsid {$Id: sqlite.tcl,v 1.14 2001/09/28 18:14:17 drh Exp $}
+set rcsid {$Id: sqlite.tcl,v 1.15 2001/09/28 23:11:24 drh Exp $}
 
 puts {<html>
 <head>
@@ -28,8 +28,7 @@ the name the file that holds the SQLite database.  If the file does
 not exist, a new one is created automatically.
 The <b>sqlite</b> program will
 then prompt you to enter SQL.  Type in SQL statements (terminated by a
-semicolon), press "Enter" and the SQL will be executed.  It's as
-simple as that!</p>
+semicolon), press "Enter" and the SQL will be executed.</p>
 
 <p>For example, to create a new SQLite database named "ex1" 
 with a single table named "tbl1", you might do this:</p>
@@ -48,6 +47,7 @@ proc Code {body} {
 
 Code {
 $ (((sqlite ex1)))
+SQLite version 2.0.0
 Enter ".help" for instructions
 sqlite> (((create table tbl1(one varchar(10), two smallint);)))
 sqlite> (((insert into tbl1 values('hello!',10);)))
@@ -60,7 +60,7 @@ sqlite>
 
 puts {
 <p>(In the example above, and in all subsequent examples, the commands
-you type are underlined shown with a green tint and the responses
+you type are underlined and shown with a green tint and the responses
 from the computer are shown in black without underlining.)</p>
 
 <p>You can terminate the sqlite program by typing your systems
@@ -85,31 +85,26 @@ sqlite>
 }
 
 puts {
-<p>If you exit sqlite and look at the contents of the directory "ex1"
-you'll see that it now contains two files: <b>sqlite_master.tcl</b>
-and <b>tbl1.tbl</b>.  The <b>tbl1.tbl</b> file contains all the
-data for table "tbl1" in your database.  The file
-<b>sqlite_master.tbl</b> is a special table found on all SQLite
-databases that records information about all other tables and
-indices.  In general, an SQLite database will contain one "*.tbl"
-file for each table and index in your database, plus the extra
-"sqlite_master.tbl" file used to store the database schema.</p>
 
 <h2>Aside: Querying the SQLITE_MASTER table</h2>
 
-<p>You can execute "SELECT" statements against the
+<p>The database schema in an SQLite database is stored in
+a special table named "sqlite_master".
+You can execute "SELECT" statements against the
 special sqlite_master table just like any other table
 in an SQLite database.  For example:</p>
 }
 
 Code {
 $ (((sqlite ex1)))
+SQlite vresion 2.0.0
 Enter ".help" for instructions
 sqlite> (((select * from sqlite_master;)))
-type = table
-name = tbl1
+    type = table
+    name = tbl1
 tbl_name = tbl1
-sql = create table tbl1(one varchar(10), two smallint)
+rootpage = 3
+     sql = create table tbl1(one varchar(10), two smallint)
 sqlite>
 }
 
index 9e29fd2a63343ceea802dddf1789b2395b25c1dc..95d5a8dc59e7bcc0c9ea91424953d45d6eb7bf1a 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Run this Tcl script to generate the vdbe.html file.
 #
-set rcsid {$Id: vdbe.tcl,v 1.6 2000/11/28 20:46:41 drh Exp $}
+set rcsid {$Id: vdbe.tcl,v 1.7 2001/09/28 23:11:24 drh Exp $}
 
 puts {<html>
 <head>
@@ -15,11 +15,15 @@ puts "<p align=center>
 (This page was last modified on [lrange $rcsid 3 4] GMT)
 </p>"
 
-# puts {
-# <blockquote><font color="red"><b>This document is
-# currently under development.  It is incomplete and contains
-# errors.  Use it accordingly.</b></font></blockquote>
-# }
+puts {
+<blockquote><font color="red"><b>
+This document describes the
+virtual machine used in SQLite version 1.0.  It has not been
+updated to reflect important changes that have occurred for
+version 2.0.  Some of the information presented below is
+obsolete and/or incorrect.  Use it accordingly.
+</b></font></blockquote>
+}
 
 puts {
 <p>If you want to know how the SQLite library works internally,