diff --git a/manifest b/manifest index c168ce953e..2541956aa5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Some\stest\scases\sfor\sread\slocks\s(CVS\s1505) -D 2004-05-31T12:34:54 +C Website\sredesign\sin\spreparation\sfor\sadding\sversion\s3\sdocumentation.\s(CVS\s1506) +D 2004-05-31T15:06:29 F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd @@ -179,32 +179,36 @@ F tool/speedtest.tcl 06c76698485ccf597b9e7dbb1ac70706eb873355 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F www/arch.fig d5f9752a4dbf242e9cfffffd3f5762b6c63b3bcf F www/arch.png 82ef36db1143828a7abc88b1e308a5f55d4336f4 -F www/arch.tcl b329ca2c8dc75cd1cf0dd714b8bb47bdd458d0da +F www/arch.tcl a40f956733cbd99e4aace05c9fb9d7a999c9477e F www/arch2.fig 613b5ac63511109064c2f93c5754ee662219937d F www/arch2.gif 49c6bb36160f03ca2b89eaa5bfb1f560c7d68ee7 F www/audit.tcl 90e09d580f79c7efec0c7d6f447b7ec5c2dce5c0 -F www/c_interface.tcl 17d8bd9e7b4fbdca47c30c8b9bcb728c351d55c0 -F www/changes.tcl a3d043896631a14091dbafdb4068980974c3834c -F www/conflict.tcl 81dd21f9a679e60aae049e9dd8ab53d59570cda2 -F www/datatypes.tcl 0fe2b810f114a909b844e50ad37a25e6ed8c7271 -F www/download.tcl 0932d7f4f0e8b2adbbd22fac73132f86e43ab4a9 +F www/c_interface.tcl 2176519fc2bd2d2cf6fe74fd806fc2d8362de2c8 +F www/changes.tcl 9d562205db584d26b358ebe93fb58039feefd1b8 +F www/common.tcl e548490c8444489064f6c1cce59d1cf177fb8664 +F www/conflict.tcl fb8a2ba83746c7fdfd9e52fa7f6aaf5c422b8246 +F www/copyright-release.html 294e011760c439c44951a6bfecd4c81a1ae359e8 +F www/copyright-release.pdf cfca3558fc97095e57c6117d08f1f5b80d95125a +F www/datatypes.tcl 566004b81c36877397ddbe6e1907aae6065f6b41 +F www/docs.tcl 60a7ce60d6f04cd5f56ab9329e0ffc22ebd6f021 +F www/download.tcl cfe0a12bc9073fe34b880b6d259fb88ba5bb502f F www/dynload.tcl 02eb8273aa78cfa9070dd4501dca937fb22b466c -F www/faq.tcl 88d3b95d9cd8e374772daa3a646c4d107e7f3e9b -F www/fileformat.tcl 56f77e435a6306b337b20b416e3b89500ba2d029 -F www/formatchng.tcl ca6cc1cb1bef9bc36f0619049d3c95e749bc6983 -F www/index.tcl bacb2a0d052845bbe3bf078765cce907ed7080a4 -F www/lang.tcl 17954f37c8bb1d25e026d97041ff6459fb89ac95 +F www/faq.tcl 3a1776818d9bd973ab0c3048ec7ad6b1ad091ae5 +F www/fileformat.tcl f71a06a0d533c7df408539c64113b4adeaf29764 +F www/formatchng.tcl 7ed8a5c871ab105f01e5defe1822ec39f70675bb +F www/index.tcl 007cbb4c92459c45c2cc097a1193cc305c989772 +F www/lang.tcl fc528581c4a406cabc138e2f17db5ef6f38615ff F www/mingw.tcl d96b451568c5d28545fefe0c80bee3431c73f69c -F www/nulls.tcl 38117d24afb81efd079b59723b985a6d654cc2e8 -F www/omitted.tcl 11037a1b557bd01405092d93dfa08898a4c26cd7 -F www/opcode.tcl b8d561f33597c62955796b797646f00144d97332 +F www/nulls.tcl f31330db8c978e675f5cd263067b32b822effa6f +F www/omitted.tcl 7bd62b6f0f53b60c5360895b16b3af8407bbca03 +F www/opcode.tcl e8c421fd2c70c503b25cedb3f9617a1f387ac7ea F www/quickstart.tcl 4e97bef825e6a4153c43afb9f97235fc4da278ab -F www/speed.tcl 2f6b1155b99d39adb185f900456d1d592c4832b3 -F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604 -F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da -F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1 +F www/speed.tcl 19cf0c1bf73c4b534dfafc95b3eacff4825740b4 +F www/sqlite.tcl b51fd15f0531a54874de785a9efba323eecd5975 +F www/tclsqlite.tcl 19191cf2a1010eaeff74c51d83fd5f5a4d899075 +F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4 -P 6c100887eeb32631e1aa914a69db959e1f58f192 -R 1d8f5d0a6729c7e39d4d87422195d60b -U danielk1977 -Z 3129e3edc85b79121f4ae67280793a64 +P 0e07006704cd441f91d5fadbf3b644fd20da79bd +R a59b4bd6ff95128c135d3274ecbe26b7 +U drh +Z 972496f8c6b40a74144e347477ed1839 diff --git a/manifest.uuid b/manifest.uuid index beab512d54..4ffb78ba3d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0e07006704cd441f91d5fadbf3b644fd20da79bd \ No newline at end of file +2052911b1fd119af9dbd81fdfe80244685f58212 \ No newline at end of file diff --git a/www/arch.tcl b/www/arch.tcl index af23deca2b..b96b602319 100644 --- a/www/arch.tcl +++ b/www/arch.tcl @@ -1,22 +1,13 @@ # # Run this Tcl script to generate the sqlite.html file. # -set rcsid {$Id: arch.tcl,v 1.11 2004/03/14 11:57:58 drh Exp $} - -puts { - - Architecture of SQLite - - -

-The Architecture Of SQLite -

} -puts "

-(This page was last modified on [lrange $rcsid 3 4] UTC) -

" - +set rcsid {$Id: arch.tcl,v 1.12 2004/05/31 15:06:29 drh Exp $} +source common.tcl +header {Architecture of SQLite} puts { -

Introduction

+

The Architecture Of SQLite

+ +

Introduction

@@ -33,7 +24,7 @@ and how they interrelate is shown at the right. The text that follows will provide a quick overview of each of these components.

-

History

+

History

There are two main C interfaces to the SQLite library: @@ -48,7 +39,7 @@ the plumbing is very different. The diagram at the right shows the structure of SQLite for version 2.8.13 and following.

-

Interface

+

Interface

Much of the public interface to the SQLite library is implemented by functions found in the main.c source file though some routines are @@ -67,11 +58,11 @@ Those symbols that are intended for external use (in other words, those symbols which form the API for SQLite) begin with sqlite_.

-

SQL Command Process

+

SQL Command Process

-

Tokenizer

+

Tokenizer

When a string containing SQL statements is to be executed, the interface passes that string to the tokenizer. The job of the tokenizer @@ -87,7 +78,7 @@ of SQLite has done it both ways and finds things generally work out nicer for the tokenizer to call the parser. YACC has it backwards.

-

Parser

+

Parser

The parser is the piece that assigns meaning to tokens based on their context. The parser for SQLite is generated using the @@ -106,7 +97,7 @@ SQLite distribution in the "tool" subdirectory. Documentation on lemon is found in the "doc" subdirectory of the distribution.

-

Code Generator

+

Code Generator

After the parser assembles tokens into complete SQL statements, it calls the code generator to produce virtual machine code that @@ -126,7 +117,7 @@ for SQL statements with the same names. (Each of these files calls routines in expr.c and where.c as necessary.) All other SQL statements are coded out of build.c.

-

Virtual Machine

+

Virtual Machine

The program generated by the code generator is executed by the virtual machine. Additional information about the virtual @@ -146,20 +137,20 @@ The vdbeaux.c file contains utilities used by the virtual machine and interface modules used by the rest of the library to construct VM programs.

-

Backend

+

Backend

The backend is an abstraction layer that presents a uniform interface to the virtual machine for either the B-Tree drivers for disk-based databases or the Red/Black Tree driver for in-memory databases. The btree.h source file contains the details.

-

Red/Black Tree

+

Red/Black Tree

In-memory databases are stored in a red/black tree implementation contain in the btree_rb.c source file.

-

B-Tree

+

B-Tree

An SQLite database is maintained on disk using a B-tree implementation found in the btree.c source file. A separate B-tree is used for @@ -173,7 +164,7 @@ entry. Any additional payload is stored in a chain of overflow pages.

btree.h.

-

Page Cache

+

Page Cache

The B-tree module requests information from the disk in 1024 byte chunks. The page cache is reponsible for reading, writing, and @@ -190,7 +181,7 @@ source file pager.c. The interface to the page cache subsystem is defined by the header file pager.h.

-

OS Interface

+

OS Interface

In order to provide portability between POSIX and Win32 operating systems, @@ -203,12 +194,4 @@ for Win32. The interface to the OS abstraction layer is defined by the os.h header file.

} - -puts { -
-


-

-Back to the SQLite Home Page -

- -} +footer $rcsid diff --git a/www/c_interface.tcl b/www/c_interface.tcl index 2a6f5fe396..953c052b8a 100644 --- a/www/c_interface.tcl +++ b/www/c_interface.tcl @@ -1,26 +1,17 @@ # # Run this Tcl script to generate the sqlite.html file. # -set rcsid {$Id: c_interface.tcl,v 1.39 2003/10/18 09:37:27 danielk1977 Exp $} - -puts { - - The C language interface to the SQLite library - - -

-The C language interface to the SQLite library -

} -puts "

-(This page was last modified on [lrange $rcsid 3 4] UTC) -

" - +set rcsid {$Id: c_interface.tcl,v 1.40 2004/05/31 15:06:29 drh Exp $} +source common.tcl +header {The C language interface to the SQLite library} puts { +

The C language interface to the SQLite library

+

The SQLite library is designed to be very easy to use from a C or C++ program. This document gives an overview of the C/C++ programming interface.

-

1.0 The Core API

+

1.0 The Core API

The interface to the SQLite library consists of three core functions, one opaque data structure, and some constants used as return values. @@ -51,7 +42,7 @@ the core functions shown above.

-

1.1 Opening a database

+

1.1 Opening a database

Use the sqlite_open function to open an existing SQLite database or to create a new SQLite database. The first argument @@ -83,7 +74,7 @@ deal with the same database. NULL is returned if the open fails for any reason.

-

1.2 Closing the database

+

1.2 Closing the database

To close an SQLite database, call the sqlite_close function passing it the sqlite structure pointer that was obtained @@ -92,7 +83,7 @@ If a transaction is active when the database is closed, the transaction is rolled back.

-

1.3 Executing SQL statements

+

1.3 Executing SQL statements

The sqlite_exec function is used to process SQL statements and queries. This function requires 5 parameters as follows:

@@ -170,7 +161,7 @@ result set is empty.

function returns non-zero, the query is immediately aborted and sqlite_exec will return SQLITE_ABORT.

-

1.4 Error Codes

+

1.4 Error Codes

The sqlite_exec function normally returns SQLITE_OK. But @@ -344,7 +335,7 @@ the sqlite_finalize routine is ready to be called. -

2.0 Accessing Data Without Using A Callback Function

+

2.0 Accessing Data Without Using A Callback Function

The sqlite_exec routine described above used to be the only @@ -390,7 +381,7 @@ once for each row of output, and finally call sqlite_finalize to clean up after the SQL has finished execution.

-

2.1 Compiling An SQL Statement Into A Virtual Machine

+

2.1 Compiling An SQL Statement Into A Virtual Machine

The sqlite_compile "compiles" a single SQL statement (specified @@ -436,7 +427,7 @@ On success, sqlite_compile returns SQLITE_OK. Otherwise and error code is returned.

-

2.2 Step-By-Step Execution Of An SQL Statement

+

2.2 Step-By-Step Execution Of An SQL Statement

After a virtual machine has been generated using sqlite_compile @@ -521,7 +512,7 @@ usage prior to a mishap. The misuse detection logic is not guaranteed to work in every case.

-

2.3 Deleting A Virtual Machine

+

2.3 Deleting A Virtual Machine

Every virtual machine that sqlite_compile creates should @@ -556,7 +547,7 @@ It is also acceptable to call sqlite_finalize on a virtual machine that has never been passed to sqlite_step even once.

-

3.0 The Extended API

+

3.0 The Extended API

Only the three core routines described in section 1.0 are required to use SQLite. But there are many other functions that provide @@ -642,7 +633,7 @@ void sqlite_progress_handler(sqlite*, int, int (*)(void*), void*);

All of the above definitions are included in the "sqlite.h" header file that comes in the source tree.

-

3.1 The ROWID of the most recent insert

+

3.1 The ROWID of the most recent insert

Every row of an SQLite table has a unique integer key. If the table has a column labeled INTEGER PRIMARY KEY, then that column @@ -658,7 +649,7 @@ the key is automatically generated. You can find the value of the key for the most recent INSERT statement using the sqlite_last_insert_rowid API function.

-

3.2 The number of rows that changed

+

3.2 The number of rows that changed

The sqlite_changes API function returns the number of rows that have been inserted, deleted, or modified since the database was @@ -686,7 +677,7 @@ will be zero regardless of the number of elements that were originally in the table. If an accurate count of the number of elements deleted is necessary, use "DELETE FROM table WHERE 1" instead.

-

3.3 Querying into memory obtained from malloc()

+

3.3 Querying into memory obtained from malloc()

The sqlite_get_table function is a wrapper around sqlite_exec that collects all the information from successive @@ -773,7 +764,7 @@ as would be returned if the result set is empty.

The sqlite_get_table routine returns the same integer result code as sqlite_exec.

-

3.4 Interrupting an SQLite operation

+

3.4 Interrupting an SQLite operation

The sqlite_interrupt function can be called from a different thread or from a signal handler to cause the current database @@ -781,7 +772,7 @@ operation to exit at its first opportunity. When this happens, the sqlite_exec routine (or the equivalent) that started the database operation will return SQLITE_INTERRUPT.

-

3.5 Testing for a complete SQL statement

+

3.5 Testing for a complete SQL statement

The next interface routine to SQLite is a convenience function used to test whether or not a string forms a complete SQL statement. @@ -803,7 +794,7 @@ then sqlite_exec is called and the input buffer is reset. If the continuation prompt and another line of text is read and added to the input buffer.

-

3.6 Library version string

+

3.6 Library version string

The SQLite library exports the string constant named sqlite_version which contains the version number of the @@ -813,7 +804,7 @@ the SQLITE_VERSION macro against the sqlite_version string constant to verify that the version number of the header file and the library match.

-

3.7 Library character encoding

+

3.7 Library character encoding

By default, SQLite assumes that all data uses a fixed-size 8-bit character (iso8859). But if you give the --enable-utf8 option @@ -830,7 +821,7 @@ be changed at run-time. This is a compile-time option only. The sqlite_encoding character string just tells you how the library was compiled.

-

3.8 Changing the library's response to locked files

+

3.8 Changing the library's response to locked files

The sqlite_busy_handler procedure can be used to register a busy callback with an open SQLite database. The busy callback will @@ -860,7 +851,7 @@ will wait for the lock to clear for at least the number of milliseconds specified before it returns SQLITE_BUSY. Specifying zero milliseconds for the timeout restores the default behavior.

-

3.9 Using the _printf() wrapper functions

+

3.9 Using the _printf() wrapper functions

The four utility functions

@@ -981,7 +972,7 @@ routine. The string pointer that these routines return should be freed by passing it to sqlite_freemem().

-

3.10 Performing background jobs during large queries

+

3.10 Performing background jobs during large queries

The sqlite_progress_handler() routine can be used to register a callback routine with an SQLite database to be invoked periodically during long @@ -1006,7 +997,7 @@ determine whether or not background jobs need to be run.

-

4.0 Adding New SQL Functions

+

4.0 Adding New SQL Functions

Beginning with version 2.4.0, SQLite allows the SQL language to be extended with new functions implemented as C code. The following interface @@ -1089,7 +1080,7 @@ new SQL functions, review the SQLite source code in the file func.c.

-

5.0 Multi-Threading And SQLite

+

5.0 Multi-Threading And SQLite

If SQLite is compiled with the THREADSAFE preprocessor macro set to 1, @@ -1112,7 +1103,7 @@ Under Unix, an sqlite* pointer should not be carried across a should open its own copy of the database after the fork().

-

6.0 Usage Examples

+

6.0 Usage Examples

For examples of how the SQLite C/C++ interface can be used, refer to the source code for the sqlite program in the @@ -1122,11 +1113,4 @@ Additional information about sqlite is available at See also the sources to the Tcl interface for SQLite in the source file src/tclsqlite.c.

} - -puts { -


-

-Back to the SQLite Home Page -

- -} +footer $rcsid diff --git a/www/changes.tcl b/www/changes.tcl index 976be2b7cb..42bb790018 100644 --- a/www/changes.tcl +++ b/www/changes.tcl @@ -1,15 +1,11 @@ # # Run this script to generated a changes.html output file # -puts { - - SQLite Change Log - - -

Recent Changes To SQLite

- +source common.tcl +header {SQLite changes} +puts {

-This file provides a high-level summary of changes to SQLite. +This page provides a high-level summary of changes to SQLite. For more detail, refer the the checkin logs generated by CVS at @@ -1097,9 +1093,5 @@ chng {2000 May 29} { puts { -


-

-Back to the SQLite Home Page -

- -} +} +footer {$Id:} diff --git a/www/common.tcl b/www/common.tcl new file mode 100644 index 0000000000..b94ec58e55 --- /dev/null +++ b/www/common.tcl @@ -0,0 +1,45 @@ +# This file contains TCL procedures used to generate standard parts of +# web pages. +# + +proc header {txt} { + puts "$txt" + puts \ +{ +
Block Diagram Of SQLite
+ + + + + +
+ + + +
+ + +
} +} + +proc footer {{rcsid {}}} { + puts { + + +
} + set date [lrange $rcsid 3 4] + if {$date!=""} { + puts "This page last modified on $date" + } + puts {} +} diff --git a/www/conflict.tcl b/www/conflict.tcl index c5200c22a5..6e276fbae9 100644 --- a/www/conflict.tcl +++ b/www/conflict.tcl @@ -1,29 +1,18 @@ # # Run this Tcl script to generate the constraint.html file. # -set rcsid {$Id: conflict.tcl,v 1.2 2002/02/03 00:56:11 drh Exp $ } - -puts { - - Constraint Conflict Resolution in SQLite - - -

-Constraint Conflict Resolution in SQLite -

} -puts "

-(This page was last modified on [lrange $rcsid 3 4] UTC) -

" - +set rcsid {$Id: conflict.tcl,v 1.3 2004/05/31 15:06:30 drh Exp $ } +source common.tcl +header {Constraint Conflict Resolution in SQLite} puts { -

Introduction

+

Constraint Conflict Resolution in SQLite

In most SQL databases, if you have a UNIQUE constraint on a table and you try to do an UPDATE or INSERT that violates -that constraint, the database will aborts the operation in -progress, back out any prior changes associated with that -one UPDATE or INSERT command, and return an error. +the constraint, the database will abort the operation in +progress, back out any prior changes associated with +UPDATE or INSERT command, and return an error. This is the default behavior of SQLite. Beginning with version 2.3.0, though, SQLite allows you to define alternative ways for dealing with constraint violations. @@ -99,11 +88,4 @@ What you really want is to use the IGNORE algorithm to insert all but the malformed record.

} - -puts { -


-

-Back to the SQLite Home Page -

- -} +footer $rcsid diff --git a/www/copyright-release.html b/www/copyright-release.html new file mode 100644 index 0000000000..bc0c764acd --- /dev/null +++ b/www/copyright-release.html @@ -0,0 +1,109 @@ + + +

+Copyright Release for
+Contributions To SQLite +

+ +

+SQLite is software that implements an embeddable SQL database engine. +SQLite is available for free download from http://www.sqlite.org/. +The principal author and maintainer of SQLite has disclaimed all +copyright interest in his contributions to SQLite +and thus released his contributions into the public domain. +In order to keep the SQLite software unencumbered by copyright +claims, the principal author asks others who may from time to +time contribute changes and enhancements to likewise disclaim +their own individual copyright interest. +

+ +

+Because the SQLite software found at http://www.sqlite.org/ is in the +public domain, anyone is free to download the SQLite software +from that website, make changes to the software, use, distribute, +or sell the modified software, under either the original name or +under some new name, without any need to obtain permission, pay +royalties, acknowledge the original source of the software, or +in any other way compensate, identify, or notify the original authors. +Nobody is in any way compelled to contribute their SQLite changes and +enhancements back to the SQLite website. This document concerns +only changes and enhancements to SQLite that are intentionally and +deliberately contributed back to the SQLite website. +

+ +

+For the purposes of this document, "SQLite software" shall mean any +computer source code, documentation, makefiles, test scripts, or +other information that is published on the SQLite website, +http://www.sqlite.org/. Precompiled binaries are excluded from +the definition of "SQLite software" in this document because the +process of compiling the software may introduce information from +outside sources which is not properly a part of SQLite. +

+ +

+The header comments on the SQLite source files exhort the reader to +share freely and to never take more than one gives. +In the spirit of that exhortation I make the following declarations: +

+ +
    +
  1. +I dedicate to the public domain +any and all copyright interest in the SQLite software that +was publicly available on the SQLite website (http://www.sqlite.org/) prior +to the date of the signature below and any changes or enhancements to +the SQLite software +that I may cause to be published on that website in the future. +I make this dedication for the benefit of the public at large and +to the detriment of my heirs and successors. I intend this +dedication to be an overt act of relinquishment in perpetuity of +all present and future rights to the SQLite software under copyright +law. +

  2. + +
  3. +To the best of my knowledge and belief, the changes and enhancements that +I have contributed to SQLite are either originally written by me +or are derived from prior works which I have verified are also +in the public domain and are not subject to claims of copyright +by other parties. +

  4. + +
  5. +To the best of my knowledge and belief, no individual, business, organization, +government, or other entity has any copyright interest +in the SQLite software as it existed on the +SQLite website as of the date on the signature line below. +

  6. + +
  7. +I agree never to publish any additional information +to the SQLite website (by CVS, email, scp, FTP, or any other means) unless +that information is an original work of authorship by me or is derived from +prior published versions of SQLite. +I agree never to copy and paste code into the SQLite code base from +other sources. +I agree never to publish on the SQLite website any information that +would violate a law or breach a contract. +

  8. +
+ +

+ + + + + +
+Signature: +

 

+

 

+

 

+
+Date: +
+Name (printed): +
+ + diff --git a/www/copyright-release.pdf b/www/copyright-release.pdf new file mode 100644 index 0000000000..9465d3179d Binary files /dev/null and b/www/copyright-release.pdf differ diff --git a/www/datatypes.tcl b/www/datatypes.tcl index 8c77876bc2..af8836207d 100644 --- a/www/datatypes.tcl +++ b/www/datatypes.tcl @@ -1,22 +1,13 @@ # # Run this script to generated a datatypes.html output file # -set rcsid {$Id: datatypes.tcl,v 1.6 2003/12/18 14:19:41 drh Exp $} +set rcsid {$Id: datatypes.tcl,v 1.7 2004/05/31 15:06:30 drh Exp $} +source common.tcl +header {Datatypes In SQLite version 2} +puts { +

Datatypes In SQLite Version 2

-puts { - - Datatypes In SQLite - - -

-Datatypes In SQLite -

-} -puts "

-(This page was last modified on [lrange $rcsid 3 4] UTC) -

" - -puts {

1.0   Typelessness

+

1.0   Typelessness

SQLite is "typeless". This means that you can store any kind of data you want in any column of any table, regardless of the @@ -79,7 +70,7 @@ And so forth. Basically any sequence of names optionally followed by one or two signed integers in parentheses will do.

-

2.0   The INTEGER PRIMARY KEY

+

2.0   The INTEGER PRIMARY KEY

One exception to the typelessness of SQLite is a column whose type @@ -101,7 +92,7 @@ the sqlite_last_insert_rowid() API function or using the last_insert_rowid() SQL function in a subsequent SELECT statement.

-

3.0   Comparison and Sort Order

+

3.0   Comparison and Sort Order

SQLite is typeless for the purpose of deciding what data is allowed @@ -144,7 +135,7 @@ A comparison of any value against NULL using operators like "<" or ">=" is always false.

-

4.0   How SQLite Determines Datatypes

+

4.0   How SQLite Determines Datatypes

For SQLite version 2.6.3 and earlier, all values used the numeric datatype. @@ -193,7 +184,7 @@ then the datatype is numeric. Note in particular that the datatype for columns with an empty type declaration is numeric.

-

5.0   Examples

+

5.0   Examples

Consider the following two command sequences: @@ -249,11 +240,4 @@ are treated as numbers and are therefore indistinct. But the SELECT statement on the right returns two rows since 0 and 0.0 are treated a strings which are different.

} - -puts { -


-

-Back to the SQLite Home Page -

- -} +footer $rcsid diff --git a/www/docs.tcl b/www/docs.tcl new file mode 100644 index 0000000000..8e9dad66d4 --- /dev/null +++ b/www/docs.tcl @@ -0,0 +1,84 @@ +# This script generates the "docs.html" page that describes various +# sources of documentation available for SQLite. +# +set rcsid {$Id: docs.tcl,v 1.1 2004/05/31 15:06:30 drh Exp $} +source common.tcl +header {SQLite Documentation} +puts { +

Available Documentation

+ +} + +proc doc {name url desc} { + puts {" + puts {} + puts {} +} + +doc {SQL Syntax} {lang.html} { + This document describes the SQL language that is understood by + SQLite. +} + +doc {Version 2 C/C++ API} {c_interface.html} { + A description of the C/C++ interface bindings for SQLite through version + 2.8 +} + +doc {Tcl API} {tclsqlite.html} { + A description of the TCL interface bindings for SQLite. +} + +doc {Version 2 DataTypes } {datatypes.html} { + A description of how SQLite version 2 handles SQL datatypes. +} + +doc {Release History} {changes.html} { + A chronology of SQLite releases going back to version 1.0.0 +} + +doc {Null Handling} {nulls.html} { + Different SQL database engines handle NULLs in different ways. The + SQL standards are ambiguous. This document describes how SQLite handles + NULLs in comparison with other SQL database engines. +} + +doc {Copyright} {copyright.html} { + SQLite is in the public domain. This document describes what that means + and the implications for contributors. +} + +doc {Unsupported SQL} {omitted.html} { + This page describes features of SQL that SQLite does not support. +} + +doc {Speed Comparison} {speed.html} { + The speed of version 2.7.6 of SQLite is compared against PostgreSQL and + MySQL. +} + +doc {Architecture} {arch.html} { + An architectural overview of the SQLite library, useful for those who want + to hack the code. +} + +doc {VDBE Tutorial} {vdbe.html} { + The VDBE is the subsystem within SQLite that does the actual work of + executing SQL statements. This page describes the principles of operation + for the VDBE in SQLite version 2.7. This is essential reading for anyone + who want to modify the SQLite sources. +} + +doc {VDBE Opcodes} {opcode.html} { + This document is an automatically generated description of the various + opcodes that the VDBE understands. Programmers can use this document as + a reference to better understand the output of EXPLAIN listings from + SQLite. +} + +puts {
} + regsub -all { +} $name {\ } name + puts "$name} + puts $desc + puts {
} +footer $rcsid diff --git a/www/download.tcl b/www/download.tcl index bdf5674a0e..943bb27e9b 100644 --- a/www/download.tcl +++ b/www/download.tcl @@ -1,12 +1,12 @@ # # Run this TCL script to generate HTML for the download.html file. # -set rcsid {$Id: download.tcl,v 1.6 2002/08/15 13:45:17 drh Exp $} +set rcsid {$Id: download.tcl,v 1.7 2004/05/31 15:06:30 drh Exp $} +source common.tcl +header {SQLite Download Page} -puts { -SQLite Download Page - -

SQLite Download Page

+puts { +

SQLite Download Page

} @@ -95,13 +95,4 @@ foreach name [lsort -dict -decreasing [glob -nocomplain sqlite-*.tar.gz]] { Version $vers of the source tree including all documentation. " } - -puts { -
-


-

- -Back to the SQLite home page -

- -} +footer $rcsid diff --git a/www/faq.tcl b/www/faq.tcl index f19049d673..d60a2643fc 100644 --- a/www/faq.tcl +++ b/www/faq.tcl @@ -1,19 +1,9 @@ # # Run this script to generated a faq.html output file # -set rcsid {$Id: faq.tcl,v 1.23 2003/05/29 17:43:08 drh Exp $} - -puts { - - SQLite Frequently Asked Questions - - -

Frequently Asked Questions

-} -puts "

-(This page was last modified on [lrange $rcsid 3 4] UTC) -

" - +set rcsid {$Id: faq.tcl,v 1.24 2004/05/31 15:06:30 drh Exp $} +source common.tcl +header {SQLite Frequently Asked Questions} set cnt 1 proc faq {question answer} { @@ -432,12 +422,19 @@ faq { # End of questions and answers. ############# -puts {
} +puts {

Frequently Asked Questions

} + +# puts {
} +# for {set i 1} {$i<$cnt} {incr i} { +# puts "
($i)
" +# puts "
[lindex $faq($i) 0]
" +# } +# puts {
} +puts {
    } for {set i 1} {$i<$cnt} {incr i} { - puts "
    ($i)
    " - puts "
    [lindex $faq($i) 0]
    " + puts "
  1. [lindex $faq($i) 0]
  2. " } -puts {
} +puts {} for {set i 1} {$i<$cnt} {incr i} { puts "
" @@ -445,11 +442,5 @@ for {set i 1} {$i<$cnt} {incr i} { puts "
[lindex $faq($i) 1]
\n" } -puts { - -


-

-Back to the SQLite Home Page -

- -} +puts {} +footer $rcsid diff --git a/www/fileformat.tcl b/www/fileformat.tcl index ff1a6180c4..d39d9e4da1 100644 --- a/www/fileformat.tcl +++ b/www/fileformat.tcl @@ -1,23 +1,19 @@ # # Run this script to generated a fileformat.html output file # -set rcsid {$Id: fileformat.tcl,v 1.11 2003/11/25 23:48:57 drh Exp $} - -puts { - - SQLite Database File Format - - -

-SQLite Database File Format -

-} -puts "

-(This page was last modified on [lrange $rcsid 3 4] UTC) -

" - +set rcsid {$Id: fileformat.tcl,v 1.12 2004/05/31 15:06:30 drh Exp $} +source common.tcl +header {SQLite Database File Format (Version 2)} puts { -

1.0   Layers

+

SQLite 2.X Database File Format

+ +

+This document describes the disk file format for SQLite versions 2.1 +through 2.8. SQLite version 3.0 and following uses a very different +format which is described separately. +

+ +

1.0   Layers

SQLite is implemented in layers. @@ -37,7 +33,7 @@ We wil describe each layer beginning with the bottom (pager) layer and working upwards.

-

2.0   The Pager Layer

+

2.0   The Pager Layer

An SQLite database consists of @@ -158,7 +154,7 @@ Here is a summary of the journal file format: -

3.0   The B-Tree Layer

+

3.0   The B-Tree Layer

The B-Tree layer builds on top of the pager layer to implement @@ -206,7 +202,7 @@ The b-tree itself does not record which pages are root pages and which are not. That information is handled entirely at the schema layer.

-

3.1   B-Tree Page 1 Details

+

3.1   B-Tree Page 1 Details

Page 1 begins with the following 48-byte string: @@ -275,7 +271,7 @@ Here is a summary of the information contained on page 1 in the b-tree layer:

  • 928 bytes of unused space
  • -

    3.2   Structure Of A Single B-Tree Page

    +

    3.2   Structure Of A Single B-Tree Page

    Conceptually, a b-tree page contains N database entries and N+1 pointers @@ -502,7 +498,7 @@ the page by moving all cells to the beginning and constructing a single freeblock at the end to take up all remaining space.

    -

    3.3   The B-Tree Free Page List

    +

    3.3   The B-Tree Free Page List

    When information is removed from an SQLite database such that one or @@ -571,7 +567,7 @@ these two optimizations allow some database operations to go four to six times faster than they would otherwise.

    -

    4.0   The Schema Layer

    +

    4.0   The Schema Layer

    The schema layer implements an SQL database on top of one or more @@ -591,7 +587,7 @@ extracted. For indices, the b-tree key varies in size depending on the size of the fields being indexed and the b-tree data is empty.

    -

    4.1   SQL Table Implementation Details

    +

    4.1   SQL Table Implementation Details

    Each row of an SQL table is stored in a single b-tree entry. The b-tree key is a 4-byte big-endian integer that is the ROWID @@ -659,7 +655,7 @@ INTEGER PRIMARY KEY, just like any other column. But the Value associated with that offset is always NULL.

    -

    4.2   SQL Index Implementation Details

    +

    4.2   SQL Index Implementation Details

    SQL indices are implement using a b-tree in which the key is used @@ -685,7 +681,7 @@ NULLs being sorted first, followed by numerical values in numerical order, followed by text values in lexigraphical order.

    -

    4.4   SQL Schema Storage And Root B-Tree Page Numbers

    +

    4.4   SQL Schema Storage And Root B-Tree Page Numbers

    The database schema is stored in the database in a special tabled named @@ -720,7 +716,7 @@ database. But the schema table for the temporary database named name change, it works exactly the same.

    -

    4.4   Schema Version Numbering And Other Meta-Information

    +

    4.4   Schema Version Numbering And Other Meta-Information

    The nine 32-bit integers that are stored beginning at byte offset @@ -785,13 +781,5 @@ to a SYNCHRONOUS setting of NORMAL. A value of 3 corresponds to a SYNCHRONOUS setting of FULL. If the value is 0, that means it has not been initialized so the default synchronous setting of NORMAL is used.

    - } - -puts { -


    -

    -Back to the SQLite Home Page -

    - -} +footer $rcsid diff --git a/www/formatchng.tcl b/www/formatchng.tcl index bc07d45ba1..b1095b5e52 100644 --- a/www/formatchng.tcl +++ b/www/formatchng.tcl @@ -1,21 +1,12 @@ # # Run this Tcl script to generate the formatchng.html file. # -set rcsid {$Id: formatchng.tcl,v 1.9 2003/06/29 16:11:13 drh Exp $ } - -puts { - - File Format Changes in SQLite - - -

    -File Format Changes in SQLite -

    } -puts "

    -(This page was last modified on [lrange $rcsid 3 4] UTC) -

    " - +set rcsid {$Id: formatchng.tcl,v 1.10 2004/05/31 15:06:30 drh Exp $ } +source common.tcl +header {File Format Changes in SQLite} puts { +

    File Format Changes in SQLite

    +

    From time to time, enhancements or bug fixes require a change to the underlying file format for SQLite. When this happens and you @@ -175,6 +166,16 @@ occurred since version 1.0.0: to restore the database.

    + + 2.8.13 to 3.0.0 + (pending) +

    Version 3.0.0 is a major upgrade for SQLite that incorporates + support for UTF-16, BLOBs, and a more compact encoding that results + in database files that are typically 25% to 35% smaller. The new file + format is radically different and completely incompatible with the + version 2 file format.

    + + @@ -192,11 +193,4 @@ this is as follows: echo .dump | sqlite-old old.db | sqlite-new new.db } - -puts { -


    -

    -Back to the SQLite Home Page -

    - -} +footer $rcsid diff --git a/www/index.tcl b/www/index.tcl index 49ea7befad..f9885edce5 100644 --- a/www/index.tcl +++ b/www/index.tcl @@ -1,223 +1,82 @@ -# -# Run this TCL script to generate HTML for the index.html file. -# -set rcsid {$Id: index.tcl,v 1.82 2004/04/23 17:04:45 drh Exp $} - -puts { -SQLite: An Embeddable SQL Database Engine - -

    SQLite
    An Embeddable SQL Database Engine

    -

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

    } - -puts {

    Introduction

    - -

    SQLite is a C library that implements an embeddable SQL database engine. -Programs that link with 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.

    - -

    SQLite is not a client library used to connect to a -big database server. SQLite is the server. The SQLite -library reads and writes directly to and from the database files -on disk.

    } - +#!/usr/bin/tclsh +source common.tcl +header {SQLite home page} puts { - - -
    -
    -Quick Links: - -
    -
    -} - -puts {

    Features

    + + + + +
    +

    About SQLite

    +

    +SQLite is a small C library that implements a +self-contained, embeddable, +zero-configuration SQL database engine. +Features include: +

      +
    • ACID (Atomic, Consistent, Isolated, Durable) transactions.
    • +
    • A zero-configuration - no DBA needed.
    • Implements most of SQL92. (Features not supported)
    • -
    • A complete database (with multiple tables and indices) is - stored in a single disk file.
    • -
    • ACID (Atomic, Consistent, Isolated, Durable) transactions.
    • +
    • A complete database is stored in a single disk file.
    • Database files can be freely shared between machines with different byte orders.
    • Supports databases up to 2 terabytes (2^41 bytes) in size.
    • -
    • A zero-configuration database engine - no DBA needed.
    • -
    • Small memory footprint: less than 30K lines of C code.
    • -
    • Two times faster than PostgreSQL and - MySQL for many common operations.
    • -
    • Very simple -C/C++ interface requires the use of only -three functions and one opaque structure.
    • +
    • Small memory footprint: less than 30K lines of C code, + less than 250KB code space (gcc on i486)
    • +
    • Faster than other popular database + engines for most common operations.
    • +
    • Simple, easy to use API.
    • TCL bindings included. Bindings for many other languages available separately.
    • -
    • Simple, well-commented source code.
    • -
    • Automated test suite provides over 90% code coverage.
    • +
    • Well-commented source code with over 90% test coverage.
    • Self-contained: no external dependencies.
    • -
    • Built and tested under Linux and Windows.
    • Sources are in the public domain. Use for any purpose.

    -} - -puts {

    Current Status

    - -

    A Change Summary is available on this -website. You can also access a detailed -change history, -view open bugs, -or -report new bugs -at the -CVS server.

    - -

    Complete source code and precompiled binaries for the latest release are -available for download on this site. You -can also obtain the latest changes by anonymous CVS access: -

    -cvs -d :pserver:anonymous@www.sqlite.org:/sqlite login
    -cvs -d :pserver:anonymous@www.sqlite.org:/sqlite checkout sqlite
    -
    -When prompted for a password, enter "anonymous". -

    -Whenever either of the first two digits in the version number -for SQLite change, it means that the underlying file format -has changed. Usually these changes are backwards compatible. -See formatchng.html -for additional information. +The SQLite 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.

    + +
    +

    News

    } -puts {

    Documentation

    +proc newsitem {date title text} { + puts "

    $date - $title

    " + regsub -all "\n( *\n)+" $text "

    \n\n

    " txt + puts "

    $txt

    " + puts "
    " +} -

    The following documentation is currently available:

    +newsitem {2004-May-31} {CVS Access Temporarily Suspended} { + Anonymous access to the CVS repository will be suspended + temporarily beginning on 2004-June-04 + so that the developers working on version 3.0 can have a free hand to + implement features that a covered by a non-compete agreement. + Access will be reenabled after the non-compete expires on 2004-June-17. +} -

    -

    - -

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

    +newsitem {2004-Apr-23} {Work Begins On SQLite Version 3} { + Work has begun on version 3 of SQLite. Version 3 is a major + changes to both the C-language API and the underlying file format + that will enable SQLite to better support internationalization. + The first beta is schedule for release on 2004-July-01. + Plans are to continue to support SQLite version 2.8 with + bug fixes. But all new development will occur in version 3.0. } puts { - -

    Mailing List

    -

    A mailing list has been set up for discussion of -SQLite design issues or for asking questions about SQLite. -To subscribe send an email to - -sqlite-users-subscribe@sqlite.org. -If you would prefer to get digests rather than individual -emails, send a message to to - -sqlite-users-digest-subscribe@sqlite.org. -For additional information about operating and using this -mailing list, send a message to - -sqlite-users-help@sqlite.org and instructions will be -sent by to you by return email. -

    +
    } - -puts {

    Professional Support and Custom Modifications

    } - -puts { -

    -If you would like professional support for SQLite -or if you want custom modifications to SQLite performed by the -original author, these services are available for a modest fee. -For additional information visit - -http://www.hwaci.com/sw/sqlite/support.html or contact:

    - -
    -D. Richard Hipp
    -Hwaci - Applied Software Research
    -704.948.4565
    -drh@hwaci.com -
    -} - -puts {

    Building From Source

    } - -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 
    -
    - -

    If you prefer, you can also build by making whatever modifications -you desire to the file "Makefile.linux-gcc" and then executing that -makefile. The latter method is used for all official development -and testing of SQLite and for building the precompiled -binaries found on this website. Windows binaries are generated by -cross-compiling from Linux using MinGW

    -} - -puts {

    Related Sites

    - -

    -For information bindings of SQLite to other programming languages -(Perl, Python, Ruby, PHP, etc.) and for a list of programs currently -using SQLite, visit the Wiki documentation at: -

    - -
    - -http://www.sqlite.org/cvstrac/wiki -
    -} - -puts { -} +footer {$Id: index.tcl,v 1.83 2004/05/31 15:06:30 drh Exp $} diff --git a/www/lang.tcl b/www/lang.tcl index 074e45b845..01c8179904 100644 --- a/www/lang.tcl +++ b/www/lang.tcl @@ -1,21 +1,12 @@ # # Run this Tcl script to generate the sqlite.html file. # -set rcsid {$Id: lang.tcl,v 1.67 2004/04/23 17:04:45 drh Exp $} - -puts { - - Query Language Understood By SQLite - - -

    -SQL As Understood By SQLite -

    } -puts "

    -(This page was last modified on [lrange $rcsid 3 4] UTC) -

    " - +set rcsid {$Id: lang.tcl,v 1.68 2004/05/31 15:06:30 drh Exp $} +source common.tcl +header {Query Language Understood by SQLite} puts { +

    SQL As Understood By SQLite

    +

    The SQLite library understands most of the standard SQL language. But it does omit some features while at the same time @@ -1841,10 +1832,4 @@ keyword_list { *SQLITE_TEMP_MASTER } -puts { -


    -

    -Back to the SQLite Home Page -

    - -} +footer $rcsid diff --git a/www/nulls.tcl b/www/nulls.tcl index 4c6ceb73a0..d2f20a1080 100644 --- a/www/nulls.tcl +++ b/www/nulls.tcl @@ -1,22 +1,12 @@ # # Run this script to generated a nulls.html output file # -set rcsid {$Id: nulls.tcl,v 1.5 2003/11/08 12:07:01 drh Exp $} - -puts { - -NULL Handling In SQLite Versus Other Database Engines - - -

    -NULL Handling in SQLite Versus Other Database Engines -

    -} -puts "

    -(This page was last modified on [lrange $rcsid 3 4] UTC) -

    " - +set rcsid {$Id: nulls.tcl,v 1.6 2004/05/31 15:06:30 drh Exp $} +source common.tcl +header {NULL Handling in SQLite} puts { +

    NULL Handling in SQLite Versus Other Database Engines

    +

    The goal is to make SQLite handle NULLs in a standards-compliant way. @@ -334,11 +324,6 @@ select * from t2; drop table t1; drop table t2; - -


    -

    -Back to the SQLite Home Page -

    - - } + +footer $rcsid diff --git a/www/omitted.tcl b/www/omitted.tcl index 32d82c8b45..91d0ac8130 100644 --- a/www/omitted.tcl +++ b/www/omitted.tcl @@ -1,22 +1,12 @@ # # Run this script to generated a omitted.html output file # -set rcsid {$Id: omitted.tcl,v 1.5 2003/08/22 02:34:30 drh Exp $} - -puts { - - SQL Features That SQLite Does Not Implement - - -

    -SQL Features That SQLite Does Not Implement -

    -} -puts "

    -(This page was last modified on [lrange $rcsid 3 4] UTC) -

    " - +set rcsid {$Id: omitted.tcl,v 1.6 2004/05/31 15:06:30 drh Exp $} +source common.tcl +header {SQL Features That SQLite Does Not Implement} puts { +

    SQL Features That SQLite Does Not Implement

    +

    Rather than try to list all the features of SQL92 that SQLite does support, it is much easier to list those that it does not. @@ -104,9 +94,5 @@ add them to the Wiki page at http://www.sqlite.org/cvstrac/wiki?p=Unsupported

    -


    -

    -Back to the SQLite Home Page -

    - -} +} +footer $rcsid diff --git a/www/opcode.tcl b/www/opcode.tcl index 840c193343..d6039f257d 100644 --- a/www/opcode.tcl +++ b/www/opcode.tcl @@ -1,19 +1,12 @@ # # Run this Tcl script to generate the sqlite.html file. # -set rcsid {$Id: opcode.tcl,v 1.12 2003/06/29 16:11:13 drh Exp $} - -puts { - - SQLite Virtual Machine Opcodes - - -

    -SQLite Virtual Machine Opcodes -

    } -puts "

    -(This page was last modified on [lrange $rcsid 3 4] UTC) -

    " +set rcsid {$Id: opcode.tcl,v 1.13 2004/05/31 15:06:30 drh Exp $} +source common.tcl +header {SQLite Virtual Machine Opcodes} +puts { +

    SQLite Virtual Machine Opcodes

    +} set fd [open [lindex $argv 0] r] set file [read $fd [file size [lindex $argv 0]]] @@ -46,7 +39,7 @@ foreach line [split $file \n] { unset file puts { -

    Introduction

    +

    Introduction

    In order to execute an SQL statement, the SQLite library first parses the SQL, analyzes the statement, then generates a short program to execute @@ -147,7 +140,7 @@ There are operations to read or write to memory slots of the aggregator in focus. There are also operations to change the focus aggregator and to scan through all aggregators.

    -

    Viewing Programs Generated By SQLite

    +

    Viewing Programs Generated By SQLite

    Every SQL statement that SQLite interprets results in a program for the virtual machine. But if you precede the SQL statement with @@ -224,7 +217,7 @@ PRAGMA vdbe_trace=on; You can turn tracing back off by entering a similar statement but changing the value "on" to "off".

    -

    The Opcodes

    +

    The Opcodes

    } puts "

    There are currently [llength $OpcodeList] opcodes defined by @@ -242,11 +235,4 @@ foreach op [lsort -dictionary $OpcodeList] { puts "[string trim $Opcode($op:text)]" } puts {

    } - -puts { -


    -

    -Back to the SQLite Home Page -

    - -} +footer $rcsid diff --git a/www/speed.tcl b/www/speed.tcl index a86814e4cc..f830cf02cf 100644 --- a/www/speed.tcl +++ b/www/speed.tcl @@ -1,22 +1,14 @@ # # Run this Tcl script to generate the speed.html file. # -set rcsid {$Id: speed.tcl,v 1.13 2003/06/29 16:11:13 drh Exp $ } - -puts { - - Database Speed Comparison: SQLite versus PostgreSQL - - -

    -Database Speed Comparison -

    } -puts "

    -(This page was last modified on [lrange $rcsid 3 4] UTC) -

    " +set rcsid {$Id: speed.tcl,v 1.14 2004/05/31 15:06:30 drh Exp $ } +source common.tcl +header {SQLite Database Speed Comparison} puts { -

    Executive Summary

    +

    Database Speed Comparison

    + +

    Executive Summary

    A series of tests were run to measure the relative performance of SQLite 2.7.6, PostgreSQL 7.1.3, and MySQL 3.23.41. @@ -61,7 +53,7 @@ The results presented here come with the following caveats:

    -

    Test Environment

    +

    Test Environment

    The platform used for these tests is a 1.6GHz Athlon with 1GB or memory @@ -132,7 +124,7 @@ synchronous) and the asynchronous SQLite times are for comparison against the asynchronous MySQL engine.

    -

    Test 1: 1000 INSERTs

    +

    Test 1: 1000 INSERTs

    CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100));
    INSERT INTO t1 VALUES(1,13153,'thirteen thousand one hundred fifty three');
    @@ -162,7 +154,7 @@ the disk surface before continuing. For most of the 13 seconds in the synchronous test, SQLite was sitting idle waiting on disk I/O to complete.

    -

    Test 2: 25000 INSERTs in a transaction

    +

    Test 2: 25000 INSERTs in a transaction

    BEGIN;
    CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100));
    @@ -187,7 +179,7 @@ have to do any fsync()s until the very end. When unshackled in this way, SQLite is much faster than either PostgreSQL and MySQL.

    -

    Test 3: 25000 INSERTs into an indexed table

    +

    Test 3: 25000 INSERTs into an indexed table

    BEGIN;
    CREATE TABLE t3(a INTEGER, b INTEGER, c VARCHAR(100));
    @@ -211,7 +203,7 @@ SQLite is not as fast at creating new index entries as the other engines (see Test 6 below) but its overall speed is still better.

    -

    Test 4: 100 SELECTs without an index

    +

    Test 4: 100 SELECTs without an index

    BEGIN;
    SELECT count(*), avg(b) FROM t2 WHERE b>=0 AND b<1000;
    @@ -237,7 +229,7 @@ enhancements have increased its speed so that it is now the fastest of the group.

    -

    Test 5: 100 SELECTs on a string comparison

    +

    Test 5: 100 SELECTs on a string comparison

    BEGIN;
    SELECT count(*), avg(b) FROM t2 WHERE c LIKE '%one%';
    @@ -261,7 +253,7 @@ SQLite is over three times faster than PostgreSQL here and about 30% faster than MySQL.

    -

    Test 6: Creating an index

    +

    Test 6: Creating an index

    CREATE INDEX i2a ON t2(a);
    CREATE INDEX i2b ON t2(b);
    @@ -278,7 +270,7 @@ is being worked on. Hopefully, future versions of SQLite will do better here.

    -

    Test 7: 5000 SELECTs with an index

    +

    Test 7: 5000 SELECTs with an index

    SELECT count(*), avg(b) FROM t2 WHERE b>=0 AND b<100;
    SELECT count(*), avg(b) FROM t2 WHERE b>=100 AND b<200;
    @@ -300,7 +292,7 @@ All three database engines run faster when they have indices to work with. But SQLite is still the fastest.

    -

    Test 8: 1000 UPDATEs without an index

    +

    Test 8: 1000 UPDATEs without an index

    BEGIN;
    UPDATE t1 SET b=b*2 WHERE a>=0 AND a<10;
    @@ -325,7 +317,7 @@ normally a very fast engine. Perhaps this problem has been addressed in later versions of MySQL.

    -

    Test 9: 25000 UPDATEs with an index

    +

    Test 9: 25000 UPDATEs with an index

    BEGIN;
    UPDATE t2 SET b=468026 WHERE a=1;
    @@ -348,7 +340,7 @@ MySQL on this test. But recent optimizations to SQLite have more than doubled speed of UPDATEs.

    -

    Test 10: 25000 text UPDATEs with an index

    +

    Test 10: 25000 text UPDATEs with an index

    BEGIN;
    UPDATE t2 SET c='one hundred forty eight thousand three hundred eighty two' WHERE a=1;
    @@ -377,7 +369,7 @@ knowledgeable administrator might be able to get PostgreSQL to run a lot faster here by tweaking and tuning the server a little.

    -

    Test 11: INSERTs from a SELECT

    +

    Test 11: INSERTs from a SELECT

    BEGIN;
    INSERT INTO t1 SELECT b,a,c FROM t2;
    INSERT INTO t2 SELECT b,a,c FROM t1;
    COMMIT;
    @@ -394,7 +386,7 @@ The PostgreSQL engine is still thrashing - most of the 61 seconds it used were spent waiting on disk I/O.

    -

    Test 12: DELETE without an index

    +

    Test 12: DELETE without an index

    DELETE FROM t2 WHERE c LIKE '%fifty%';
    @@ -410,7 +402,7 @@ but the asynchronous version is the fastest. The difference is the extra time needed to execute fsync().

    -

    Test 13: DELETE with an index

    +

    Test 13: DELETE with an index

    DELETE FROM t2 WHERE a>10 AND a<20000;
    @@ -426,7 +418,7 @@ PostgreSQL is faster than MySQL. The asynchronous SQLite is, however, faster then both the other two.

    -

    Test 14: A big INSERT after a big DELETE

    +

    Test 14: A big INSERT after a big DELETE

    INSERT INTO t2 SELECT * FROM t1;
    @@ -443,7 +435,7 @@ sequence of DELETEs followed by new INSERTs. As this test shows, the problem has now been resolved.

    -

    Test 15: A big DELETE followed by many small INSERTs

    +

    Test 15: A big DELETE followed by many small INSERTs

    BEGIN;
    DELETE FROM t1;
    @@ -465,7 +457,7 @@ SQLite is very good at doing INSERTs within a transaction, which probably explains why it is so much faster than the other databases at this test.

    -

    Test 16: DROP TABLE

    +

    Test 16: DROP TABLE

    DROP TABLE t1;
    DROP TABLE t2;
    DROP TABLE t3;
    @@ -489,10 +481,4 @@ so if SQLite takes a little longer, that is not seen as a big problem.

    } -puts { -


    -

    -Back to the SQLite Home Page -

    - -} +footer $rcsid diff --git a/www/sqlite.tcl b/www/sqlite.tcl index b777074733..cce4a63686 100644 --- a/www/sqlite.tcl +++ b/www/sqlite.tcl @@ -1,27 +1,18 @@ # # Run this Tcl script to generate the sqlite.html file. # -set rcsid {$Id: sqlite.tcl,v 1.21 2003/06/29 16:11:13 drh Exp $} - -puts { - - sqlite: A program of interacting with SQLite databases - - -

    -sqlite: A program to administer SQLite databases -

    } -puts "

    -(This page was last modified on [lrange $rcsid 3 4] UTC) -

    " - +set rcsid {$Id: sqlite.tcl,v 1.22 2004/05/31 15:06:30 drh Exp $} +source common.tcl +header {sqlite: A program of interacting with SQLite databases} puts { +

    sqlite: A command-line program to administer SQLite databases

    +

    The SQLite library includes a simple command-line utility named sqlite that allows the user to manually enter and execute SQL commands against an SQLite database. This document provides a brief introduction on how to use sqlite. -

    Getting Started

    +

    Getting Started

    To start the sqlite program, just type "sqlite" followed by the name the file that holds the SQLite database. If the file does @@ -84,7 +75,7 @@ sqlite> puts { -

    Aside: Querying the SQLITE_MASTER table

    +

    Aside: Querying the SQLITE_MASTER table

    The database schema in an SQLite database is stored in a special table named "sqlite_master". @@ -123,7 +114,7 @@ is stored in another special table named "sqlite_temp_master". The "sqlite_temp_master" table is temporary itself.

    -

    Special commands to sqlite

    +

    Special commands to sqlite

    Most of the time, sqlite just reads lines of input and passes them @@ -168,7 +159,7 @@ sqlite> } puts { -

    Changing Output Formats

    +

    Changing Output Formats

    The sqlite program is able to show the results of a query in five different formats: "line", "column", "list", "html", and "insert". @@ -305,7 +296,7 @@ CGI.

    } puts { -

    Writing results to a file

    +

    Writing results to a file

    By default, sqlite sends query results to standard output. You can change this using the ".output" command. Just put the name of @@ -326,7 +317,7 @@ $ } puts { -

    Querying the database schema

    +

    Querying the database schema

    The sqlite program provides several convenience commands that are useful for looking at the schema of the database. There is @@ -441,7 +432,7 @@ sqlite> (((.databases))) } puts { -

    Converting An Entire Database To An ASCII Text File

    +

    Converting An Entire Database To An ASCII Text File

    Use the ".dump" command to convert the entire contents of a database into a single ASCII text file. This file can be converted @@ -495,7 +486,7 @@ $ (((pg_dump -a ex2 | sqlite ex3))) } puts { -

    Other Dot Commands

    +

    Other Dot Commands

    The ".explain" dot command can be used to set the output mode to "column" and to set the column widths to values that are reasonable @@ -539,7 +530,7 @@ index is locked.

    And finally, we mention the ".exit" command which causes the sqlite program to exit.

    -

    Using sqlite in a shell script

    +

    Using sqlite in a shell script

    One way to use sqlite in a shell script is to use "echo" or @@ -564,7 +555,7 @@ $ } puts { -

    Ending shell commands

    +

    Ending shell commands

    SQLite commands are normally terminated by a semicolon. In the shell @@ -576,18 +567,11 @@ to that function.

    } puts { -

    Compiling the sqlite program from sources

    +

    Compiling the sqlite program from sources

    The sqlite program is built automatically when you compile the sqlite library. Just get a copy of the source tree, run "configure" and then "make".

    } - -puts { -


    -

    -Back to the SQLite Home Page -

    - -} +footer $rcsid diff --git a/www/tclsqlite.tcl b/www/tclsqlite.tcl index 776967d1b6..4cc6bfdf9f 100644 --- a/www/tclsqlite.tcl +++ b/www/tclsqlite.tcl @@ -1,26 +1,17 @@ # # Run this Tcl script to generate the tclsqlite.html file. # -set rcsid {$Id: tclsqlite.tcl,v 1.8 2003/08/19 14:31:02 drh Exp $} - -puts { - - The Tcl interface to the SQLite library - - -

    -The Tcl interface to the SQLite library -

    } -puts "

    -(This page was last modified on [lrange $rcsid 3 4] UTC) -

    " - +set rcsid {$Id: tclsqlite.tcl,v 1.9 2004/05/31 15:06:30 drh Exp $} +source common.tcl +header {The Tcl interface to the SQLite library} puts { +

    The Tcl interface to the SQLite library

    +

    The SQLite library is designed to be very easy to use from a Tcl or Tcl/Tk script. This document gives an overview of the Tcl programming interface.

    -

    The API

    +

    The API

    The interface to the SQLite library consists of single tcl command named sqlite. Because there is only this @@ -69,7 +60,7 @@ defined:

    We will explain all of these methods, though not in that order. We will be begin with the "close" method.

    -

    The "close" method

    +

    The "close" method

    As its name suggests, the "close" method to an SQLite database just @@ -93,7 +84,7 @@ to the previous:

    rename db1 {} -

    The "eval" method

    +

    The "eval" method

    The most useful dbcmd method is "eval". The eval method is used @@ -193,7 +184,7 @@ a=2 b=goodbye
    a=3 b=howdy! -

    The "complete" method

    +

    The "complete" method

    The "complete" method takes a string of supposed SQL as its only argument. @@ -206,7 +197,7 @@ This is really just an interface to the sqlite_complete() C function. Refer to the C/C++ interface specification for additional information.

    -

    The "timeout" method

    +

    The "timeout" method

    The "timeout" method is used to control how long the SQLite library will wait for locks to clear before giving up on a database transaction. @@ -233,7 +224,7 @@ number. For example:

    to wait for the lock to clear. So in the example above, the maximum delay would be 2 seconds.

    -

    The "busy" method

    +

    The "busy" method

    The "busy" method, like "timeout", only comes into play when the database is locked. But the "busy" method gives the programmer much more @@ -245,12 +236,12 @@ so that the lock can be tried again. The callback procedure should return "0" if it wants SQLite to try again to open the database and should return "1" if it wants SQLite to abandon the current operation. -

    The "last_insert_rowid" method

    +

    The "last_insert_rowid" method

    The "last_insert_rowid" method returns an integer which is the ROWID of the most recently inserted database row.

    -

    The "onecolumn" method

    +

    The "onecolumn" method

    The "onecolumn" method works like "eval" in that it evaluates the SQL query statement given as its argument. The difference is that @@ -261,18 +252,11 @@ first row of the query result.

    do a "[lindex ... 0]" on the results of an "eval" in order to extract a single column result.

    -

    The "changes" method

    +

    The "changes" method

    The "changes" method returns an integer which is the number of rows in the database that were inserted, deleted, and/or modified by the most recent "eval" method.

    } - -puts { -


    -

    -Back to the SQLite Home Page -

    - -} +footer $rcsid diff --git a/www/vdbe.tcl b/www/vdbe.tcl index 9b1037f185..68bae0cf85 100644 --- a/www/vdbe.tcl +++ b/www/vdbe.tcl @@ -1,21 +1,12 @@ # # Run this Tcl script to generate the vdbe.html file. # -set rcsid {$Id: vdbe.tcl,v 1.11 2003/06/29 16:11:13 drh Exp $} - -puts { - - The Virtual Database Engine of SQLite - - -

    -The Virtual Database Engine of SQLite -

    } -puts "

    -(This page was last modified on [lrange $rcsid 3 4] UTC) -

    " - +set rcsid {$Id: vdbe.tcl,v 1.12 2004/05/31 15:06:30 drh Exp $} +source common.tcl +header {The Virtual Database Engine of SQLite} puts { +

    The Virtual Database Engine of SQLite

    +
    This document describes the virtual machine used in SQLite version 2.8.0.
    @@ -1989,11 +1980,4 @@ feel free to fix them and/or contact the author at drh@hwaci.com. Your bug fixes or suggestions are always welcomed.

    } - -puts { -


    -

    -Back to the SQLite Home Page -

    - -} +footer $rcsid