]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Documentation for REINDEX and ALTER TABLE commands. (CVS 2118)
authordanielk1977 <danielk1977@noemail.net>
Sat, 20 Nov 2004 08:17:18 +0000 (08:17 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Sat, 20 Nov 2004 08:17:18 +0000 (08:17 +0000)
FossilOrigin-Name: aceaa5f6e97c93962f5d6d14de8a490efa619db4

manifest
manifest.uuid
www/compile.tcl
www/lang.tcl
www/pragma.tcl

index 78275c3438ad61473dd0e77b55149d04aa4b2a23..c97d3ac349a544862ad31e87a0bcdc654c078345 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\sa\sdocumentation\spage\sfor\scompilation\soptions.\sStill\ssome\swork\sto\sgo.\s(CVS\s2117)
-D 2004-11-20T06:05:56
+C Documentation\sfor\sREINDEX\sand\sALTER\sTABLE\scommands.\s(CVS\s2118)
+D 2004-11-20T08:17:18
 F Makefile.in e747bb5ba34ccbdd81f79dcf1b2b33c02817c21d
 F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
 F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
@@ -230,7 +230,7 @@ F www/capi3.tcl 5c1cb163f4d2a54e2d0e22dcc399dd71245c8b89
 F www/capi3ref.tcl 28e70284fb1a833dbc513b9972cb0a245d4a7d60
 F www/changes.tcl f2b34859843d9f06a0611eb6d44af767891b09ef
 F www/common.tcl de758130d54d95d151ea0d17a2ae5b92e1bb01de
-F www/compile.tcl b13d9a7a138ca9dae738140b777c5485521c4275
+F www/compile.tcl d9431a45a7551e833b0361ca5826831205276b05
 F www/conflict.tcl cdd0f4b59b0ba6d61f67e6a38f3ae45853bacb30
 F www/copyright-release.html 294e011760c439c44951a6bfecd4c81a1ae359e8
 F www/copyright-release.pdf cfca3558fc97095e57c6117d08f1f5b80d95125a
@@ -244,14 +244,14 @@ F www/faq.tcl abe360e630d8134bc6242c5e3664969c397eac6e
 F www/fileformat.tcl 900c95b9633abc3dcfc384d9ddd8eb4876793059
 F www/formatchng.tcl bfbf14dbf5181e771d06da7797767b0200b36d8a
 F www/index.tcl bb67c0d13020641d1fb4c043afa1f40fcc144d88
-F www/lang.tcl aa6ccee5ad4ed13a24fd6f902c7c7c57a57549db
+F www/lang.tcl b2d8272bc89d94db373b4f1d071b1faa1153109a
 F www/lockingv3.tcl f59b19d6c8920a931f096699d6faaf61c05db55f
 F www/mingw.tcl d96b451568c5d28545fefe0c80bee3431c73f69c
 F www/nulls.tcl ec35193f92485b87b90a994a01d0171b58823fcf
 F www/oldnews.tcl 7aa4478e64631859770a5fe4b413919ba6ee8a08
 F www/omitted.tcl 7bd62b6f0f53b60c5360895b16b3af8407bbca03
 F www/opcode.tcl dafa030a5a3cc24a2f9fd4cfbfb7d7323d2151b0
-F www/pragma.tcl 9e22b9d8954677a2fa842997095aea2b430fd2d3
+F www/pragma.tcl 39c4a2be847538360c5d3e234f40a11f2eb08916
 F www/quickstart.tcl 6f6f694b6139be2d967b1492eb9a6bdf7058aa60
 F www/speed.tcl de99c82c4729a10b6733463636f15473c4ec95bc
 F www/sqlite.tcl b51fd15f0531a54874de785a9efba323eecd5975
@@ -260,7 +260,7 @@ F www/tclsqlite.tcl 560ecd6a916b320e59f2917317398f3d59b7cc25
 F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618
 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
 F www/whentouse.tcl fdacb0ba2d39831e8a6240d05a490026ad4c4e4c
-P ea315668e5833befe296fc94c67f914061d2ffb2
-R b7737c068e16cb857c9f3b56f1cad115
+P 5efa2d2a602c3b7249c4e6701e97b16b5ad0280d
+R 502686892546d476cbd8522ca98f27e6
 U danielk1977
-Z c876a87c3a381106862832380625540a
+Z 626ea436eea0d0f50a92b6b634fdfd52
index 535f642310eb31332c6706f314e41363ce6ba3b4..7ad6e663c6d13b459db2f4b1bf8e614aef0a8d5b 100644 (file)
@@ -1 +1 @@
-5efa2d2a602c3b7249c4e6701e97b16b5ad0280d
\ No newline at end of file
+aceaa5f6e97c93962f5d6d14de8a490efa619db4
\ No newline at end of file
index 9fa8f451155152e9c81a2835268e6bbe1146607d..3a1bba8481b4a5666cf0615d16733923c0715ece 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Run this Tcl script to generate the compile.html file.
 #
-set rcsid {$Id: compile.tcl,v 1.1 2004/11/20 06:05:56 danielk1977 Exp $ }
+set rcsid {$Id: compile.tcl,v 1.2 2004/11/20 08:17:18 danielk1977 Exp $ }
 source common.tcl
 header {Compilation Options For SQLite}
 
@@ -62,12 +62,18 @@ compilation switches all have the same effect:<br>
 -DSQLITE_OMIT_ALTERTABLE=0
 </p>
 
+<p>If any of these options are defined, then the same set of SQLITE_OMIT_XXX
+options must also be defined when using the 'lemon' tool to generate a parse.c
+file. Because of this, these options may only used when the library is built
+from source, not from the collection of pre-packaged C files provided for
+non-UNIX like platforms on the website.
+</p>
+
 <p><b>SQLITE_OMIT_ALTERTABLE</b><br>
 When this option is defined, the 
 <a href="lang_altertable.html">ALTER TABLE</a> command is not included in the 
 library. Executing an ALTER TABLE statement causes a parse error.
 </p>
-<p><i>TODO: Need a link here - ALTER TABLE is not documented yet</i><p>
 
 <p><b>SQLITE_OMIT_AUTHORIZATION</b><br>
 Defining this option omits the authorization callback feature from the
@@ -181,8 +187,7 @@ API function is not present in the library.
 When this option is defined, the <a href="lang_reindex.html">REINDEX</a> 
 command is not included in the library. Executing a REINDEX statement causes 
 a parse error.
-
-<p><i>TODO: Need a link here - REINDEX is not documented yet</i><p>
+</p>
 
 <p><b>SQLITE_OMIT_SCHEMA_PRAGMAS</b><br>
 Defining this option omits pragmas for querying the database schema from 
@@ -195,23 +200,36 @@ pragmas are omitted.
 </p>
 
 <p><b>SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS</b><br>
-Defining this option omits pragmas for querying the database schema from 
-the build. Currently, the 
-<a href="pragma.html#pragma_table_info">table_info</a>,
-<a href="pragma.html#pragma_index_info">index_info</a>,
-<a href="pragma.html#pragma_index_list">index_list</a> and
-<a href="pragma.html#pragma_database_list">database_list</a>
+Defining this option omits pragmas for querying and modifying the 
+database schema version and user version from the build. Specifically, the 
+<a href="pragma.html#pragma_schema_version">schema_version</a> and
+<a href="pragma.html#pragma_user_version">user_version</a>
 pragmas are omitted.
-</p>
 
 <p><b>SQLITE_OMIT_TCL_VARIABLE</b><br>
-<i>Document me!</i></p>
+<p>If this macro is defined, then the special "$<variable-name>" syntax
+used to automatically bind SQL variables to TCL variables is omitted.
+</p>
 
 <p><b>SQLITE_OMIT_TRIGGER</b><br>
-<i>Document me!</i></p>
+Defining this option omits support for VIEW objects. Neither the 
+<a href="lang_createtrigger.html">CREATE TRIGGER</a> or 
+<a href="lang_droptrigger.html">DROP TRIGGER</a> 
+commands are available in this case, attempting to execute either will result
+in a parse error.
+</p>
+<p>
+WARNING: If this macro is defined, it will not be possible to open a database
+for which the schema contains TRIGGER objects. 
+</p>
 
 <p><b>SQLITE_OMIT_UTF16</b><br>
-<i>Document me!</i></p>
+This macro is used to omit support for UTF16 text encoding. When this is
+defined all API functions that return or accept UTF16 encoded text are
+unavailable. These functions can be identified by the fact that they end
+with '16', for example sqlite3_prepare16(), sqlite3_column_text16() and
+sqlite3_bind_text16().
+</p>
 
 <p><b>SQLITE_OMIT_VACUUM</b><br>
 When this option is defined, the <a href="lang_vacuum.html">VACUUM</a> 
@@ -220,7 +238,16 @@ a parse error.
 </p>
 
 <p><b>SQLITE_OMIT_VIEW</b><br>
-<i>Document me!</i></p>
+Defining this option omits support for VIEW objects. Neither the 
+<a href="lang_createview.html">CREATE VIEW</a> or 
+<a href="lang_dropview.html">DROP VIEW</a> 
+commands are available in this case, attempting to execute either will result
+in a parse error.
+</p>
+<p>
+WARNING: If this macro is defined, it will not be possible to open a database
+for which the schema contains VIEW objects. 
+</p>
 }
 footer $rcsid
 
index 81797902b09ec88de3a35ca0ddb0153d3100c5e7..8f8e4212031df447641b110b2e4d5a435de73dd4 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Run this Tcl script to generate the sqlite.html file.
 #
-set rcsid {$Id: lang.tcl,v 1.78 2004/11/19 11:59:24 danielk1977 Exp $}
+set rcsid {$Id: lang.tcl,v 1.79 2004/11/20 08:17:18 danielk1977 Exp $}
 source common.tcl
 
 if {[llength $argv]>0} {
@@ -74,6 +74,8 @@ foreach {section} [lsort -index 0 -dictionary {
   {{DROP TRIGGER} droptrigger}
   {{ATTACH DATABASE} attach}
   {{DETACH DATABASE} detach}
+  {REINDEX reindex}
+  {{ALTER TABLE} altertable}
 }] {
   foreach {s_title s_tag} $section {}
   puts "<li><a href=\"[slink $s_tag]\">$s_title</a></li>"
@@ -132,6 +134,28 @@ proc Section {name label} {
   puts "<h1>$name</h1>\n"
 }
 
+Section {ALTER TABLE} altertable
+
+Syntax {sql-statement} {
+ALTER TABLE [<database-name> .] <table-name> RENAME TO <new-table-name>
+}
+
+puts {
+<p>SQLite's version of the ALTER TABLE command allows the user to 
+rename an existing table. The table identified by 
+<i>[database-name.]table-name</i> is renamed to
+<i>new-table-name</i>. This command cannot be used to move a
+table between attached databases, only to rename a table within
+the same database.</p>
+
+<p>If the table being renamed has triggers or indices, then these remain
+attached to the table after it has been renamed. However, if there are
+any view definitions, or statements executed by triggers that refer to
+the table being renamed, these are not automatically modified to use the new
+table name. If this is required, the triggers or view definitions must be
+dropped and recreated to use the new table name by hand.
+</p>
+}
 
 Section {ATTACH DATABASE} attach
 
@@ -1299,6 +1323,35 @@ If no algorithm is specified anywhere, the ABORT algorithm is used.</p>
 # <p>For additional information, see 
 # <a href="conflict.html">conflict.html</a>.</p>
 
+Section REINDEX reindex
+
+Syntax {sql-statement} {
+  REINDEX <collation name>
+}
+Syntax {sql-statement} {
+  REINDEX [<database-name> .] <table/index-name>
+}
+
+puts {
+<p>The REINDEX command is used to delete and recreate indices from scratch.
+This is primarily useful when the definition of a collation sequence has 
+changed.
+</p>
+
+<p>In the first form, all indices in all attached databases that use the
+named collation sequence are recreated. In the second form, if 
+<i>[database-name.]table/index-name</i> identifies a table, then all indices
+associated with the table are rebuilt. If an index is identified, then only
+this specific index is deleted and recreated.
+</p>
+
+<p>If no <i>database-name</i> is specified and there exists both a table or
+index and a collation sequence of the specified name, then indices associated
+with the collation sequence only are reconstructed. This ambiguity may be
+dispelled by always specifying a <i>database-name</i> when reindexing a
+specific table or index.
+}
+
 Section REPLACE replace
 
 Syntax {sql-statement} {
@@ -1560,6 +1613,7 @@ keyword_list {
   *DETACH
   EACH
   END
+  EXPLAIN
   *EXPLAIN
   *FAIL
   FOR
@@ -1617,6 +1671,7 @@ keyword_list {
   DROP
   ELSE
   EXCEPT
+  ESCAPE
   FOREIGN
   FROM 
   *GLOB
index 950d77ac1747bbe749e0bffd29b78b25ab5912c6..47cd61ad89caac08eb72cc7270334f375397c27d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Run this Tcl script to generate the pragma.html file.
 #
-set rcsid {$Id: pragma.tcl,v 1.5 2004/11/20 06:05:56 danielk1977 Exp $}
+set rcsid {$Id: pragma.tcl,v 1.6 2004/11/20 08:17:18 danielk1977 Exp $}
 source common.tcl
 header {Pragma statements supported by SQLite}
 
@@ -224,6 +224,7 @@ Section {Pragmas to query the database schema} schema
 
 puts {
 <ul>
+<a name="pragma_database_list"></a>
 <li><p><b>PRAGMA database_list;</b></p>
     <p>For each open database, invoke the callback function once with
     information about that database.  Arguments include the index and 
@@ -231,24 +232,28 @@ puts {
     the main database.  The second row will be for the database used to 
     store temporary tables.</p></li>
 
+<a name="pragma_foreign_key_list"></a>
 <li><p><b>PRAGMA foreign_key_list(</b><i>table-name</i><b>);</b></p>
     <p>For each foreign key that references a column in the argument
     table, invoke the callback function with information about that
     foreign key. The callback function will be invoked once for each
     column in each foreign key.</p></li>
 
+<a name="pragma_index_info"></a>
 <li><p><b>PRAGMA index_info(</b><i>index-name</i><b>);</b></p>
     <p>For each column that the named index references, invoke the 
     callback function
     once with information about that column, including the column name,
     and the column number.</p></li>
 
+<a name="pragma_index_list"></a>
 <li><p><b>PRAGMA index_list(</b><i>table-name</i><b>);</b></p>
     <p>For each index on the named table, invoke the callback function
     once with information about that index.  Arguments include the
     index name and a flag to indicate whether or not the index must be
     unique.</p></li>
 
+<a name="pragma_table_info"></a>
 <li><p><b>PRAGMA table_info(</b><i>table-name</i><b>);</b></p>
     <p>For each column in the named table, invoke the callback function
     once with information about that column, including the column name,
@@ -262,6 +267,8 @@ Section {Pragmas to query/modify version values} version
 puts {
 
 <ul>
+<a name="pragma_schema_version"></a>
+<a name="pragma_user_version"></a>
 <li><p><b>PRAGMA [database.]schema_version; 
        <br>PRAGMA [database.]schema_version = </b><i>integer </i><b>;
        <br>PRAGMA [database.]user_version;