From: danielk1977
Date: Sat, 20 Nov 2004 08:17:18 +0000 (+0000)
Subject: Documentation for REINDEX and ALTER TABLE commands. (CVS 2118)
X-Git-Tag: version-3.6.10~4032
X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9c852bfd58ce9475469613a920da5f67bfa7106;p=thirdparty%2Fsqlite.git
Documentation for REINDEX and ALTER TABLE commands. (CVS 2118)
FossilOrigin-Name: aceaa5f6e97c93962f5d6d14de8a490efa619db4
---
diff --git a/manifest b/manifest
index 78275c3438..c97d3ac349 100644
--- 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
diff --git a/manifest.uuid b/manifest.uuid
index 535f642310..7ad6e663c6 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-5efa2d2a602c3b7249c4e6701e97b16b5ad0280d
\ No newline at end of file
+aceaa5f6e97c93962f5d6d14de8a490efa619db4
\ No newline at end of file
diff --git a/www/compile.tcl b/www/compile.tcl
index 9fa8f45115..3a1bba8481 100644
--- a/www/compile.tcl
+++ b/www/compile.tcl
@@ -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:
-DSQLITE_OMIT_ALTERTABLE=0
+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.
+
+
SQLITE_OMIT_ALTERTABLE
When this option is defined, the
ALTER TABLE command is not included in the
library. Executing an ALTER TABLE statement causes a parse error.
-TODO: Need a link here - ALTER TABLE is not documented yet
SQLITE_OMIT_AUTHORIZATION
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 REINDEX
command is not included in the library. Executing a REINDEX statement causes
a parse error.
-
-
TODO: Need a link here - REINDEX is not documented yet
+
SQLITE_OMIT_SCHEMA_PRAGMAS
Defining this option omits pragmas for querying the database schema from
@@ -195,23 +200,36 @@ pragmas are omitted.
SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
-Defining this option omits pragmas for querying the database schema from
-the build. Currently, the
-table_info,
-index_info,
-index_list and
-database_list
+Defining this option omits pragmas for querying and modifying the
+database schema version and user version from the build. Specifically, the
+schema_version and
+user_version
pragmas are omitted.
-
SQLITE_OMIT_TCL_VARIABLE
-Document me!
+If this macro is defined, then the special "$" syntax
+used to automatically bind SQL variables to TCL variables is omitted.
+
SQLITE_OMIT_TRIGGER
-Document me!
+Defining this option omits support for VIEW objects. Neither the
+CREATE TRIGGER or
+DROP TRIGGER
+commands are available in this case, attempting to execute either will result
+in a parse error.
+
+
+WARNING: If this macro is defined, it will not be possible to open a database
+for which the schema contains TRIGGER objects.
+
SQLITE_OMIT_UTF16
-Document me!
+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().
+
SQLITE_OMIT_VACUUM
When this option is defined, the VACUUM
@@ -220,7 +238,16 @@ a parse error.
SQLITE_OMIT_VIEW
-Document me!
+Defining this option omits support for VIEW objects. Neither the
+CREATE VIEW or
+DROP VIEW
+commands are available in this case, attempting to execute either will result
+in a parse error.
+
+
+WARNING: If this macro is defined, it will not be possible to open a database
+for which the schema contains VIEW objects.
+
}
footer $rcsid
diff --git a/www/lang.tcl b/www/lang.tcl
index 81797902b0..8f8e421203 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.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 "$s_title"
@@ -132,6 +134,28 @@ proc Section {name label} {
puts "$name
\n"
}
+Section {ALTER TABLE} altertable
+
+Syntax {sql-statement} {
+ALTER TABLE [ .] RENAME TO
+}
+
+puts {
+SQLite's version of the ALTER TABLE command allows the user to
+rename an existing table. The table identified by
+[database-name.]table-name is renamed to
+new-table-name. This command cannot be used to move a
+table between attached databases, only to rename a table within
+the same database.
+
+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.
+
+}
Section {ATTACH DATABASE} attach
@@ -1299,6 +1323,35 @@ If no algorithm is specified anywhere, the ABORT algorithm is used.
# For additional information, see
# conflict.html.
+Section REINDEX reindex
+
+Syntax {sql-statement} {
+ REINDEX
+}
+Syntax {sql-statement} {
+ REINDEX [ .]
+}
+
+puts {
+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.
+
+
+In the first form, all indices in all attached databases that use the
+named collation sequence are recreated. In the second form, if
+[database-name.]table/index-name 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.
+
+
+If no database-name 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 database-name 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
diff --git a/www/pragma.tcl b/www/pragma.tcl
index 950d77ac17..47cd61ad89 100644
--- a/www/pragma.tcl
+++ b/www/pragma.tcl
@@ -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 {
+
PRAGMA database_list;
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.
+
PRAGMA foreign_key_list(table-name);
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.
+
PRAGMA index_info(index-name);
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.
+
PRAGMA index_list(table-name);
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.
+
PRAGMA table_info(table-name);
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 {