/ Check-in [3252269e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment::-) (CVS 88)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3252269e9005fe3f31f285506430e33d1031da88
User & Date: drh 2000-06-09 03:47:19
Context
2000-06-09
03:51
:-) (CVS 89) check-in: 8de283de user: drh tags: trunk
03:47
:-) (CVS 88) check-in: 3252269e user: drh tags: trunk
01:58
:-) (CVS 87) check-in: 3661b5ff user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to www/index.tcl.

     1      1   #
     2      2   # Run this TCL script to generate HTML for the index.html file.
     3      3   #
     4         -set rcsid {$Id: index.tcl,v 1.15 2000/06/08 19:38:36 drh Exp $}
            4  +set rcsid {$Id: index.tcl,v 1.16 2000/06/09 03:47:19 drh Exp $}
     5      5   
     6      6   puts {<html>
     7      7   <head><title>SQLite: An SQL Database Engine Built Atop GDBM</title></head>
     8      8   <body bgcolor=white>
     9      9   <h1 align=center>SQLite: An SQL Database Engine Built Atop
    10     10   <a href="http://www.gnu.org/software/gdbm/gdbm.html">GDBM</a></h1>
    11     11   <p align=center>}
................................................................................
    90     90   <p>The following documentation is currently available:</p>
    91     91   
    92     92   <p><ul>
    93     93   <li>Information on the <a href="sqlite.html">sqlite</a>
    94     94       command-line utility.</li>
    95     95   <li>The <a href="c_interface.html">C/C++ Interface</a>.</li>
    96     96   <li>The <a href="fileformat.html">file format</a> used by SQLite databases.</li>
           97  +<li>The <a href="arch.html">Architecture of the SQLite Library</a> describes
           98  +    how the library is put together.  <b>(preliminary)</b></li>
           99  +<li>The <a href="lang.html">SQL Language</a> subset understood by SQLite.
          100  +    <b>(under development)</b></li>
    97    101   </ul>
    98    102   </p>
    99    103   
   100    104   <p>The SQLite source code is 35% comment.  These comments are
   101    105   another important source of information. </p>
   102    106   }
   103    107   

Changes to www/lang.tcl.

     1      1   #
     2      2   # Run this Tcl script to generate the sqlite.html file.
     3      3   #
     4         -set rcsid {$Id: lang.tcl,v 1.2 2000/06/09 01:58:37 drh Exp $}
            4  +set rcsid {$Id: lang.tcl,v 1.3 2000/06/09 03:47:19 drh Exp $}
     5      5   
     6      6   puts {<html>
     7      7   <head>
     8      8     <title>Query Language Understood By SQLite</title>
     9      9   </head>
    10     10   <body bgcolor=white>
    11     11   <h1 align=center>
................................................................................
    42     42     {{DROP TABLE} droptable}
    43     43     {{DROP INDEX} dropindex}
    44     44     {INSERT insert}
    45     45     {DELETE delete}
    46     46     {UPDATE update}
    47     47     {SELECT select}
    48     48     {COPY copy}
           49  +  {EXPLAIN explain}
           50  +  {expressions expr}
    49     51   }] {
    50     52     puts "<li><a href=\"#[lindex $section 1]\">[lindex $section 0]</a></li>"
    51     53   }
    52     54   puts {</ul></p>
    53     55   
    54     56   <p>Details on the implementation of each command are provided in
    55     57   the sequel.</p>
................................................................................
    63     65       regsub -all < $body {%LT} body
    64     66       regsub -all > $body {%GT} body
    65     67       regsub -all %LT $body {</font></b><i><font color="#ff3434">} body
    66     68       regsub -all %GT $body {</font></i><b><font color="#2c2cf0">} body
    67     69       regsub -all {[]|[*?]} $body {</font></b>&<b><font color="#2c2cf0">} body
    68     70       regsub -all "\n" [string trim $body] "<br>\n" body
    69     71       regsub -all "\n  *" $body "\n\\&nbsp;\\&nbsp;\\&nbsp;\\&nbsp;" body
    70         -    regsub -all {[|,*()]} $body {<big>&</big>} body
           72  +    regsub -all {[|,.*()]} $body {<big>&</big>} body
           73  +    regsub -all { = } $body { <big>=</big> } body
           74  +    regsub -all {STAR} $body {<big>*</big>} body
    71     75       puts "<td><b><font color=\"#2c2cf0\">$body</font></b></td></tr>"
    72     76     }
    73     77     puts {</table>}
    74     78   }
    75     79   
    76     80   proc Section {name {label {}}} {
    77     81     puts "\n<hr />"
................................................................................
    80     84     }
    81     85     puts "<h1>$name</h1>\n"
    82     86   }
    83     87   
    84     88   proc Example {text} {
    85     89     puts "<blockquote><pre>$text</pre></blockquote>"
    86     90   }
           91  +
           92  +Section COPY copy
           93  +
           94  +Syntax {sql-statement} {
           95  +COPY <table-name> FROM <string>
           96  +}
           97  +
           98  +Section {CREATE INDEX} createindex
           99  +
          100  +Syntax {sql-statement} {
          101  +CREATE INDEX <index-name> 
          102  +ON <table-name> ( <column-name> [, <column-name>]* )
          103  +} {column-name} {
          104  +<name> [ ASC | DESC ]
          105  +}
          106  +
          107  +puts {
          108  +<p>The CREATE INDEX command consists of the keywords "CREATE INDEX" followed
          109  +by the name of the new index, the keyword "ON" the name of a previously
          110  +created table that is to be indexed, and a parenthesized list of names of
          111  +columns in the table that are used for the index key.
          112  +Each column name can be followed by one of the "ASC" or "DESC" keywords
          113  +to indicate sort order, but since GDBM does not implement ordered keys,
          114  +these keywords are ignored.</p>
          115  +
          116  +<p>There are no arbitrary limits on the number of indices that can be
          117  +attached to a single table, nor on the number of columns in an index.</p>
          118  +
          119  +<p>The exact text
          120  +of each CREATE INDEX statement is stored in the <b>sqlite_master</b>
          121  +table.  Everytime the database is opened, all CREATE INDEX statements
          122  +are read from the <b>sqlite_master</b> table and used to regenerate
          123  +SQLite's internal representation of the index layout.</p>
          124  +}
          125  +
    87    126   
    88    127   Section {CREATE TABLE} {createtable}
    89    128   
    90    129   Syntax {sql-command} {
    91    130   CREATE TABLE <table-name> (
    92    131     <column-def> [, <column-def>]*
    93    132     [, <constraint>]*
................................................................................
   136    175   <p>The exact text
   137    176   of each CREATE TABLE statement is stored in the <b>sqlite_master</b>
   138    177   table.  Everytime the database is opened, all CREATE TABLE statements
   139    178   are read from the <b>sqlite_master</b> table and used to regenerate
   140    179   SQLite's internal representation of the table layout.</p>
   141    180   }
   142    181   
   143         -Section {CREATE INDEX} createindex
          182  +Section DELETE delete
   144    183   
   145    184   Syntax {sql-statement} {
   146         -CREATE INDEX <index-name> 
   147         -ON <table-name> ( <column-name> [, <column-name>]* )
   148         -} {column-name} {
   149         -<name> [ ASC | DESC ]
          185  +DELETE FROM <table-name> [WHERE <expression>]
          186  +}
          187  +
          188  +puts {
          189  +<p></p>
          190  +}
          191  +
          192  +Section {DROP INDEX} dropindex
          193  +
          194  +Syntax {sql-command} {
          195  +DROP INDEX <index-name>
   150    196   }
   151    197   
   152    198   puts {
   153         -<p>The CREATE INDEX command consists of the keywords "CREATE INDEX" followed
   154         -by the name of the new index, the keyword "ON" the name of a previously
   155         -created table that is to be indexed, and a parenthesized list of names of
   156         -columns in the table that are used for the index key.
   157         -Each column name can be followed by one of the "ASC" or "DESC" keywords
   158         -to indicate sort order, but since GDBM does not implement ordered keys,
   159         -these keywords are ignored.</p>
   160         -
   161         -<p>There are no arbitrary limits on the number of indices that can be
   162         -attached to a single table, nor on the number of columns in an index.</p>
   163         -
   164         -<p>The exact text
   165         -of each CREATE INDEX statement is stored in the <b>sqlite_master</b>
   166         -table.  Everytime the database is opened, all CREATE INDEX statements
   167         -are read from the <b>sqlite_master</b> table and used to regenerate
   168         -SQLite's internal representation of the index layout.</p>
          199  +<p>The DROP INDEX statement consists of the keywords "DROP INDEX" followed
          200  +by the name of the index.  The index named is completely removed from
          201  +the disk.  The only way to recover the index is to reenter the
          202  +appropriate CREATE INDEX command.</p>
   169    203   }
   170         -
   171    204   
   172    205   Section {DROP TABLE} droptable
   173    206   
   174    207   Syntax {sql-command} {
   175    208   DROP TABLE <table-name>
   176    209   }
   177    210   
   178    211   puts {
   179    212   <p>The DROP TABLE statement consists of the keywords "DROP TABLE" followed
   180    213   by the name of the table.  The table named is completely removed from
   181    214   the disk.  The table can not be recovered.  All indices associated with
   182    215   the table are also reversibly deleted.</p>}
   183    216   
   184         -Section {DROP INDEX} dropindex
          217  +Section EXPLAIN explain
          218  +
          219  +Syntax {sql-statement} {
          220  +EXPLAIN <sql-statement>
          221  +}
          222  +
          223  +Section expression expr
          224  +
          225  +Syntax {expression} {
          226  +<expression> <binary-op> <expression> |
          227  +<expression> <like-op> <expression> |
          228  +<unary-op> <expression> |
          229  +( <expression> ) |
          230  +<column-name> |
          231  +<table-name> . <column-name> |
          232  +<literal-value> |
          233  +<function-name> ( <expr-list> | STAR ) |
          234  +<expression> ISNULL |
          235  +<expression> NOTNULL |
          236  +<expression> BETWEEN <expression> AND <expression> |
          237  +<expression> IN ( <value-list> ) |
          238  +<expression> IN ( <select> ) |
          239  +( <select> )
          240  +} {like-op} {
          241  +LIKE | GLOB | NOT LIKE | NOT GLOB
          242  +}
          243  +
          244  +Section INSERT insert
          245  +
          246  +Syntax {sql-statement} {
          247  +INSERT INTO <table-name> [( <column-list> )] VALUES ( <value-list> ) |
          248  +INSERT INTO <table-name> [( <column-list> )] <select-statement>
          249  +}
          250  +
          251  +puts {
          252  +<p>The INSERT statement comes in two basic forms.  The first form
          253  +(with the "VALUES" keyword) creates a single new row in an existing table.
          254  +If no column-list is specified then the number of values must
          255  +be the same as the number of columns in the table.  If a column-list
          256  +is specified, then the number of values must match the number of
          257  +specified columns.  Columns of the table that do not appear in the
          258  +column list are fill with the default value, or with NULL if not
          259  +default value is specified.
          260  +</p>
          261  +
          262  +<p>The second form of the INSERT statement takes it data from a
          263  +SELECT statement.  The number of columns in the result of the
          264  +SELECT must exactly match the number of columns in the table if
          265  +no column list is specified, or it must match the number of columns
          266  +name in the column list.  A new entry is made in the table
          267  +for every row of the SELECT result.  The SELECT may be simple
          268  +or compound.  If the SELECT statement has an ORDER BY clause,
          269  +the ORDER BY is ignored.</p>
          270  +}
          271  +
          272  +Section SELECT select
          273  +
          274  +Syntax {sql-statement} {
          275  +SELECT <result> FROM <table-list> 
          276  +[WHERE <expression>]
          277  +[GROUP BY <expr-list>]
          278  +[HAVING <expression>]
          279  +[<compound-op> <select>]*
          280  +[ORDER BY <sort-expr-list>]
          281  +} {result} {
          282  +STAR | <expresssion> [, <expression>]*
          283  +} {table-list} {
          284  +<table-name> [, <table-name>]*
          285  +} {sort-expr-list} {
          286  +<expr> [<sort-order>] [, <expr> [<sort-order>]]*
          287  +} {sort-order} {
          288  +ASC | DESC
          289  +} {compound_op} {
          290  +UNION | UNION ALL | INTERSECT | EXCEPT
          291  +}
          292  +
          293  +Section UPDATE update
   185    294   
   186         -Syntax {sql-command} {
   187         -DROP INDEX <index-name>
          295  +Syntax {sql-statement} {
          296  +UPDATE <table-name> SET <assignment> [, <assignment>] [WHERE <expression>]
          297  +} {assignment} {
          298  +<column-name> = <expression>
   188    299   }
   189    300   
   190    301   puts {
   191         -<p>The DROP INDEX statement consists of the keywords "DROP INDEX" followed
   192         -by the name of the index.  The index named is completely removed from
   193         -the disk.  The only way to recover the index is to reenter the
   194         -appropriate CREATE INDEX command.</p>
          302  +<p>
   195    303   }
   196    304   
   197    305   Section VACUUM vacuum
   198    306   
   199    307   Syntax {sql-statement} {
   200    308   VACUUM [<index-or-table-name>]
   201    309   }
................................................................................
   210    318   <p>It is a good idea to run VACUUM after creating large indices,
   211    319   especially indices where a single index value refers to many
   212    320   entries in the data table.  Reorganizing these indices will make
   213    321   the underlying GDBM file much smaller and will help queries to
   214    322   run much faster.</p>
   215    323   }
   216    324   
   217         -Section INSERT insert
   218         -
   219         -Syntax {sql-statement} {
   220         -INSERT INTO <table-name> [( <column-list> )] VALUES ( <value-list> ) |
   221         -INSERT INTO <table-name> [( <column-list> )] <select-statement>
   222         -}
   223         -
   224    325   puts {
   225         -<p>The INSERT statement comes in two basic forms.  The first form
   226         -(with the "VALUES" keyword) creates a single new row in an existing table.
   227         -If no column-list is specified then the number of values must
   228         -be the same as the number of columns in the table.  If a column-list
   229         -is specified, then the number of values must match the number of
   230         -specified columns
   231         -</p>
          326  +<p></p>
   232    327   }
   233    328   
   234    329   puts {
   235    330   <p><hr /></p>
   236    331   <p><a href="index.html"><img src="/goback.jpg" border=0 />
   237    332   Back to the SQLite Home Page</a>
   238    333   </p>
   239    334   
   240    335   </body></html>}