Updates to the documentation on the TCL bindings. (CVS 2692)

FossilOrigin-Name: 94aa2d32459e1cee2df21fcc7df76c73dab903cd
This commit is contained in:
drh 2005-09-13 07:00:05 +00:00
parent b27795c183
commit 111cf34f7a
3 changed files with 82 additions and 41 deletions

View File

@ -1,5 +1,5 @@
C Fix\sa\scomment\stypo\sin\sthe\sprevious\scheck-in.\s(CVS\s2691)
D 2005-09-13T00:02:17
C Updates\sto\sthe\sdocumentation\son\sthe\sTCL\sbindings.\s(CVS\s2692)
D 2005-09-13T07:00:06
F Makefile.in 12784cdce5ffc8dfb707300c34e4f1eb3b8a14f1
F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -303,11 +303,11 @@ F www/speed.tcl 656ed5be8cc9d536353e1a96927b925634a62933
F www/sqlite.tcl b51fd15f0531a54874de785a9efba323eecd5975
F www/support.tcl 3955da0fd82be68cc5c83d347c05095e80967051
F www/table-ex1b2.gif a588d21a2d88bb2a2ef0431fcc5ed5aa48c0bbc5
F www/tclsqlite.tcl 3df553505b6efcad08f91e9b975deb2e6c9bb955
F www/tclsqlite.tcl ddcf912ea48695603c8ed7efb29f0812ef8d1b49
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P 2ec2bd85741e36e410f05ff34de430ffbcf51eea
R b171a63011a54449dcf8edd901e67fad
P 49c952807dabd80bfeb46caf55856aaab988226c
R f4b62448ad898dcbe88a2a2c62a4eed4
U drh
Z 882a9bbd917dee19aef70ec8d9b5e775
Z fae3e7ef8ecd16d6b2c3c92286508790

View File

@ -1 +1 @@
49c952807dabd80bfeb46caf55856aaab988226c
94aa2d32459e1cee2df21fcc7df76c73dab903cd

View File

@ -1,7 +1,7 @@
#
# Run this Tcl script to generate the tclsqlite.html file.
#
set rcsid {$Id: tclsqlite.tcl,v 1.14 2005/08/02 17:38:19 drh Exp $}
set rcsid {$Id: tclsqlite.tcl,v 1.15 2005/09/13 07:00:06 drh Exp $}
source common.tcl
header {The Tcl interface to the SQLite library}
proc METHOD {name text} {
@ -41,20 +41,27 @@ way widgets are created in Tk.
<p>
The name of the database is just the name of a disk file in which
the database is stored.
the database is stored. If the name of the database is an empty
string or the special name ":memory:" then a new database is created
in memory.
</p>
<p>
Once an SQLite database is open, it can be controlled using
methods of the <i>dbcmd</i>. There are currently 19 methods
methods of the <i>dbcmd</i>. There are currently 21 methods
defined:</p>
<p>The <b>sqlite3</b> also accepts an optional third argument called
the "mode". This argument is a legacy from SQLite version 2 and is
currently ignored.</p>
<p>
<ul>
}
foreach m [lsort {
authorizer
busy
cache
changes
close
collate
@ -85,32 +92,6 @@ not in the order shown above.</p>
}
##############################################################################
METHOD close {
<p>
As its name suggests, the "close" method to an SQLite database just
closes the database. This has the side-effect of deleting the
<i>dbcmd</i> Tcl command. Here is an example of opening and then
immediately closing a database:
</p>
<blockquote>
<b>sqlite3 db1 ./testdb<br>
db1 close</b>
</blockquote>
<p>
If you delete the <i>dbcmd</i> directly, that has the same effect
as invoking the "close" method. So the following code is equivalent
to the previous:</p>
<blockquote>
<b>sqlite3 db1 ./testdb<br>
rename db1 {}</b>
</blockquote>
}
##############################################################################
METHOD eval {
<p>
@ -231,6 +212,32 @@ since it avoids making a copy of the content of $bigblob.
}
##############################################################################
METHOD close {
<p>
As its name suggests, the "close" method to an SQLite database just
closes the database. This has the side-effect of deleting the
<i>dbcmd</i> Tcl command. Here is an example of opening and then
immediately closing a database:
</p>
<blockquote>
<b>sqlite3 db1 ./testdb<br>
db1 close</b>
</blockquote>
<p>
If you delete the <i>dbcmd</i> directly, that has the same effect
as invoking the "close" method. So the following code is equivalent
to the previous:</p>
<blockquote>
<b>sqlite3 db1 ./testdb<br>
rename db1 {}</b>
</blockquote>
}
##############################################################################
METHOD transaction {
@ -269,6 +276,38 @@ The <i>transaction-type</i> can be one of <b>deferred</b>,
</p>
}
##############################################################################
METHOD cache {
<p>
The "eval" method described <a href="#eval">above</a> keeps a cache of
<a href="capi3ref.html#sqlite3_prepare">prepared statements</a>
for recently evaluated SQL commands.
The "cache" method is used to control this cache.
The first form of this command is:</p>
<blockquote>
<i>dbcmd</i>&nbsp;&nbsp;<b>cache size</b>&nbsp;&nbsp;<i>N</i>
</blockquote>
<p>This sets the maximum number of statements that can be cached.
The upper limit is 100. The default is 10. If you set the cache size
to 0, no caching is done.</p>
<p>The second form of the command is this:</p>
<blockquote>
<i>dbcmd</i>&nbsp;&nbsp;<b>cache flush</b>
</blockquote>
<p>The cache-flush method
<a href="capi3ref.html#sqlite3_finalize">finalizes</a>
all prepared statements currently
in the cache.</p>
}
##############################################################################
METHOD complete {
@ -279,9 +318,9 @@ there is more to be entered.</p>
<p>The "complete" method is useful when building interactive applications
in order to know when the user has finished entering a line of SQL code.
This is really just an interface to the <b>sqlite3_complete()</b> C
function. Refer to the <a href="c_interface.html">C/C++ interface</a>
specification for additional information.</p>
This is really just an interface to the
<a href="capi3ref.html#sqlite3_complete"><b>sqlite3_complete()</b></a> C
function.
}
##############################################################################
@ -426,7 +465,8 @@ representation for NULL values is an empty string.</p>
##############################################################################
METHOD onecolumn {
<p>The "onecolumn" method works like "eval" in that it evaluates the
<p>The "onecolumn" method works like
"<a href="#eval">eval</a>" in that it evaluates the
SQL query statement given as its argument. The difference is that
"onecolumn" returns a single element which is the first column of the
first row of the query result.</p>
@ -455,7 +495,8 @@ current database connection was first opened.</p>
##############################################################################
METHOD authorizer {
<p>The "authorizer" method provides access to the sqlite3_set_authorizer
<p>The "authorizer" method provides access to the
<a href="capi3ref.html#sqlite3_set_authorizer">sqlite3_set_authorizer</a>
C/C++ interface. The argument to authorizer is the name of a procedure that
is called when SQL statements are being compiled in order to authorize
certain operations. The callback procedure takes 5 arguments which describe