From d7805f08dd7c79ff7697afb4ea10029f845b3f9f Mon Sep 17 00:00:00 2001 From: drh Date: Fri, 9 Jun 2000 03:47:19 +0000 Subject: [PATCH] :-) (CVS 88) FossilOrigin-Name: 3252269e9005fe3f31f285506430e33d1031da88 --- manifest | 14 ++-- manifest.uuid | 2 +- www/index.tcl | 6 +- www/lang.tcl | 183 ++++++++++++++++++++++++++++++++++++++------------ 4 files changed, 152 insertions(+), 53 deletions(-) diff --git a/manifest b/manifest index e520d591bb..5b2448754c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C :-)\s(CVS\s87) -D 2000-06-09T01:58:36 +C :-)\s(CVS\s88) +D 2000-06-09T03:47:19 F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4 F Makefile.in a0cc8da380c65002af452dfb72b3e82e1d33b04d F README 51f6a4e7408b34afa5bc1c0485f61b6a4efb6958 @@ -59,11 +59,11 @@ F www/arch.tcl 282d91f509aadd0873f8aa9b357a2c0b4b175979 F www/c_interface.tcl 9ac800854272db5fe439e07b7435b243a5422293 F www/changes.tcl 04e66b4257589ff78a7e1de93e9dda4725fb03d6 F www/fileformat.tcl b11435fcd2cf2238a1c5e6d16fe5e83bcd14d434 -F www/index.tcl b2c288000f14383501b157a57ee4506561d62f45 -F www/lang.tcl eb6a297c55d9856c94da4635eab815b09e4f96bb +F www/index.tcl ecbcaab2fc36974f1de09e4c2d49683f83fb2e67 +F www/lang.tcl d694c3f3614aa6a6903923437d8f520a2ee97332 F www/opcode.tcl 8be80bace48450ef4b9a34dcef4f846f7e5fb2b5 F www/sqlite.tcl 5420eab24b539928f80ea9b3088e2549d34f438d -P 049abcb37def4200fb8f4ad7cea60a1d53ee3219 -R cbc86aaf3901beefb4f0dfae3fd3db17 +P 3661b5ff93b01da7fea9f85370ecdda1402b7164 +R 1c91211af4f45cd4c54a752007d31361 U drh -Z 0d4f983c5b2e1877564119b56f0ca7bf +Z aa73dbfe7525340c7da35901373ae50e diff --git a/manifest.uuid b/manifest.uuid index e72df032b4..1a5d8bf89a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3661b5ff93b01da7fea9f85370ecdda1402b7164 \ No newline at end of file +3252269e9005fe3f31f285506430e33d1031da88 \ No newline at end of file diff --git a/www/index.tcl b/www/index.tcl index e2e59aa64e..a378cbfa63 100644 --- a/www/index.tcl +++ b/www/index.tcl @@ -1,7 +1,7 @@ # # Run this TCL script to generate HTML for the index.html file. # -set rcsid {$Id: index.tcl,v 1.15 2000/06/08 19:38:36 drh Exp $} +set rcsid {$Id: index.tcl,v 1.16 2000/06/09 03:47:19 drh Exp $} puts { SQLite: An SQL Database Engine Built Atop GDBM @@ -94,6 +94,10 @@ Among the SQL features that SQLite does not currently implement are:

command-line utility.
  • The C/C++ Interface.
  • The file format used by SQLite databases.
  • +
  • The Architecture of the SQLite Library describes + how the library is put together. (preliminary)
  • +
  • The SQL Language subset understood by SQLite. + (under development)
  • diff --git a/www/lang.tcl b/www/lang.tcl index cba2b1ebcf..89fd41fdab 100644 --- a/www/lang.tcl +++ b/www/lang.tcl @@ -1,7 +1,7 @@ # # Run this Tcl script to generate the sqlite.html file. # -set rcsid {$Id: lang.tcl,v 1.2 2000/06/09 01:58:37 drh Exp $} +set rcsid {$Id: lang.tcl,v 1.3 2000/06/09 03:47:19 drh Exp $} puts { @@ -46,6 +46,8 @@ foreach {section} [lsort -index 0 -dictionary { {UPDATE update} {SELECT select} {COPY copy} + {EXPLAIN explain} + {expressions expr} }] { puts "
  • [lindex $section 0]
  • " } @@ -67,7 +69,9 @@ proc Syntax {args} { regsub -all {[]|[*?]} $body {&} body regsub -all "\n" [string trim $body] "
    \n" body regsub -all "\n *" $body "\n\\ \\ \\ \\ " body - regsub -all {[|,*()]} $body {&} body + regsub -all {[|,.*()]} $body {&} body + regsub -all { = } $body { = } body + regsub -all {STAR} $body {*} body puts "$body" } puts {} @@ -85,6 +89,41 @@ proc Example {text} { puts "
    $text
    " } +Section COPY copy + +Syntax {sql-statement} { +COPY FROM +} + +Section {CREATE INDEX} createindex + +Syntax {sql-statement} { +CREATE INDEX +ON ( [, ]* ) +} {column-name} { + [ ASC | DESC ] +} + +puts { +

    The CREATE INDEX command consists of the keywords "CREATE INDEX" followed +by the name of the new index, the keyword "ON" the name of a previously +created table that is to be indexed, and a parenthesized list of names of +columns in the table that are used for the index key. +Each column name can be followed by one of the "ASC" or "DESC" keywords +to indicate sort order, but since GDBM does not implement ordered keys, +these keywords are ignored.

    + +

    There are no arbitrary limits on the number of indices that can be +attached to a single table, nor on the number of columns in an index.

    + +

    The exact text +of each CREATE INDEX statement is stored in the sqlite_master +table. Everytime the database is opened, all CREATE INDEX statements +are read from the sqlite_master table and used to regenerate +SQLite's internal representation of the index layout.

    +} + + Section {CREATE TABLE} {createtable} Syntax {sql-command} { @@ -140,34 +179,28 @@ are read from the sqlite_master table and used to regenerate SQLite's internal representation of the table layout.

    } -Section {CREATE INDEX} createindex +Section DELETE delete Syntax {sql-statement} { -CREATE INDEX -ON ( [, ]* ) -} {column-name} { - [ ASC | DESC ] +DELETE FROM [WHERE ] } puts { -

    The CREATE INDEX command consists of the keywords "CREATE INDEX" followed -by the name of the new index, the keyword "ON" the name of a previously -created table that is to be indexed, and a parenthesized list of names of -columns in the table that are used for the index key. -Each column name can be followed by one of the "ASC" or "DESC" keywords -to indicate sort order, but since GDBM does not implement ordered keys, -these keywords are ignored.

    - -

    There are no arbitrary limits on the number of indices that can be -attached to a single table, nor on the number of columns in an index.

    - -

    The exact text -of each CREATE INDEX statement is stored in the sqlite_master -table. Everytime the database is opened, all CREATE INDEX statements -are read from the sqlite_master table and used to regenerate -SQLite's internal representation of the index layout.

    +

    } +Section {DROP INDEX} dropindex + +Syntax {sql-command} { +DROP INDEX +} + +puts { +

    The DROP INDEX statement consists of the keywords "DROP INDEX" followed +by the name of the index. The index named is completely removed from +the disk. The only way to recover the index is to reenter the +appropriate CREATE INDEX command.

    +} Section {DROP TABLE} droptable @@ -181,17 +214,92 @@ by the name of the table. The table named is completely removed from the disk. The table can not be recovered. All indices associated with the table are also reversibly deleted.

    } -Section {DROP INDEX} dropindex +Section EXPLAIN explain -Syntax {sql-command} { -DROP INDEX +Syntax {sql-statement} { +EXPLAIN +} + +Section expression expr + +Syntax {expression} { + | + | + | +( ) | + | + . | + | + ( | STAR ) | + ISNULL | + NOTNULL | + BETWEEN AND | + IN ( ) | + IN ( ) +} {like-op} { +LIKE | GLOB | NOT LIKE | NOT GLOB +} + +Section INSERT insert + +Syntax {sql-statement} { +INSERT INTO [( )] VALUES ( ) | +INSERT INTO [( )] } puts { -

    The DROP INDEX statement consists of the keywords "DROP INDEX" followed -by the name of the index. The index named is completely removed from -the disk. The only way to recover the index is to reenter the -appropriate CREATE INDEX command.

    +

    The INSERT statement comes in two basic forms. The first form +(with the "VALUES" keyword) creates a single new row in an existing table. +If no column-list is specified then the number of values must +be the same as the number of columns in the table. If a column-list +is specified, then the number of values must match the number of +specified columns. Columns of the table that do not appear in the +column list are fill with the default value, or with NULL if not +default value is specified. +

    + +

    The second form of the INSERT statement takes it data from a +SELECT statement. The number of columns in the result of the +SELECT must exactly match the number of columns in the table if +no column list is specified, or it must match the number of columns +name in the column list. A new entry is made in the table +for every row of the SELECT result. The SELECT may be simple +or compound. If the SELECT statement has an ORDER BY clause, +the ORDER BY is ignored.

    +} + +Section SELECT select + +Syntax {sql-statement} { +SELECT FROM +[WHERE ] +[GROUP BY ] +[HAVING ] +[