Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Merge changes from 3.10.0. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
7d40b685958ed7407ffb7caa3ed07958 |
User & Date: | drh 2016-01-12 13:44:54.758 |
Context
2016-01-13
| ||
20:52 | Add documentation for the fts5 detail= option. (check-in: 08f6990b8a user: dan tags: trunk) | |
2016-01-12
| ||
13:44 | Merge changes from 3.10.0. (check-in: 7d40b68595 user: drh tags: trunk) | |
13:44 | Fix typos in the TCL interface documentation. (check-in: 217ea4895f user: drh tags: branch-3.10) | |
2016-01-11
| ||
13:00 | Begin entering 3.11.0 changes. (check-in: 166fc2da3a user: drh tags: trunk) | |
Changes
Changes to pages/tclsqlite.in.
︙ | ︙ | |||
77 78 79 80 81 82 83 | <dt><b>-readonly</b> <i>BOOLEAN</i></dt> <dd><p> If true, then open the database file read-only. If false, then the database is opened for both reading and writing if filesystem permissions allow, or for reading only if filesystem write permission is denied by the operating system. The default setting is "false". Note that | | < < < < < < < < | | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | <dt><b>-readonly</b> <i>BOOLEAN</i></dt> <dd><p> If true, then open the database file read-only. If false, then the database is opened for both reading and writing if filesystem permissions allow, or for reading only if filesystem write permission is denied by the operating system. The default setting is "false". Note that if the previous process to have the database did not exit cleanly and left behind a [hot journal], then the write permission is required to recover the database after opening, and the database cannot be opened read-only. </p></dd> <dt><b>-uri</b> <i>BOOLEAN</i></dt> <dd><p> If true, then interpret the filename argument as a [URI filename]. If false, then the argument is a literal filename. The default value is "false". </p></dd> <dt><b>-vfs</b> <i>VFSNAME</i></dt> <dd><p> Use an alternative [VFS] named by the argument. </p></dd> </dl> </blockquote> <tcl> set method_list [lsort { authorizer backup busy cache changes close collate |
︙ | ︙ | |||
141 142 143 144 145 146 147 | total_changes trace transaction unlock_notify update_hook version wal_hook | | > > > > > > > > > > > > > > > > > > > > > | | | > | | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | total_changes trace transaction unlock_notify update_hook version wal_hook }] </tcl> <p> Once an SQLite database is open, it can be controlled using methods of the <i>dbcmd</i>. <tcl> hd_puts "There are currently [llength $method_list] methods\n" hd_puts "defined.</p>\n" </tcl> <table border=0 cellpadding=10 width='100%'> <tr><td valign='top'><ul> <tcl> set nbr [expr {int(([llength $method_list]+2)/3)}] set i -1 foreach m $method_list { incr i if {$i==$nbr} { hd_puts "</ul></td>\n<td valign='top'><ul>\n" set i 0 } hd_puts "<li><a href=\"#$m\">$m</a></li>\n" } </tcl> </ul></td></tr> </table> <p>The use of each of these methods will be explained in the sequel, though not in the order shown above.</p> <tcl> ############################################################################## METHOD eval { <p> The most useful <i>dbcmd</i> method is "eval". The eval method is used to execute SQL on the database. The syntax of the eval method looks like this:</p> <blockquote> <i>dbcmd</i> <b>eval</b> <i>sql</i> ?<i>array-name</i>? ?<i>script</i>? </blockquote> <p> The job of the eval method is to execute the SQL statement or statements given in the second argument. For example, to create a new table in a database, you can do this:</p> |
︙ | ︙ | |||
279 280 281 282 283 284 285 | </p> <p> If the $bigstring variable has both a string and a "bytearray" representation, then TCL inserts the value as a string. If it has only a "bytearray" representation, then the value is inserted as a BLOB. To force a value to be inserted as a BLOB even if it also has a text representation, | | | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | </p> <p> If the $bigstring variable has both a string and a "bytearray" representation, then TCL inserts the value as a string. If it has only a "bytearray" representation, then the value is inserted as a BLOB. To force a value to be inserted as a BLOB even if it also has a text representation, use a "@" character to in place of the "$". Like this: </p> <blockquote><b> db1 eval {INSERT INTO t1 VALUES(5,@bigstring)} </b></blockquote> <p> |
︙ | ︙ | |||
364 365 366 367 368 369 370 | <p> The syntax looks like this: </p> <blockquote> <i>dbcmd</i> <b>transaction</b> <i>?transaction-type?</i> | | | 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | <p> The syntax looks like this: </p> <blockquote> <i>dbcmd</i> <b>transaction</b> <i>?transaction-type?</i> <i>script</i> </blockquote> <p> The <i>transaction-type</i> can be one of <b>deferred</b>, <b>exclusive</b> or <b>immediate</b>. The default is deferred. </p> |
︙ | ︙ | |||
432 433 434 435 436 437 438 | The "copy" method copies data from a file into a table. It returns the number of rows processed successfully from the file. The syntax of the copy method looks like this:</p> <blockquote> <i>dbcmd</i> <b>copy</b> <i>conflict-algorithm</i> <i>table-name </i> <i>file-name </i> | | | 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 | The "copy" method copies data from a file into a table. It returns the number of rows processed successfully from the file. The syntax of the copy method looks like this:</p> <blockquote> <i>dbcmd</i> <b>copy</b> <i>conflict-algorithm</i> <i>table-name </i> <i>file-name </i> ?<i>column-separator</i>? ?<i>null-indicator</i>? </blockquote> <p>Conflict-algorithm must be one of the SQLite conflict algorithms for the INSERT statement: <i>rollback</i>, <i>abort</i>, <i>fail</i>,<i>ignore</i>, or <i>replace</i>. See the SQLite Language section for <a href="lang.html#conflict">ON CONFLICT</a> for more information. |
︙ | ︙ | |||
459 460 461 462 463 464 465 | The default is an empty string. Note that column-separator and null-indicator are optional positional arguments; if null-indicator is specified, a column-separator argument must be specified and precede the null-indicator argument.</p> <p>The copy method implements similar functionality to the <b>.import</b> SQLite shell command. | < < < < < < < < < < < | 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | The default is an empty string. Note that column-separator and null-indicator are optional positional arguments; if null-indicator is specified, a column-separator argument must be specified and precede the null-indicator argument.</p> <p>The copy method implements similar functionality to the <b>.import</b> SQLite shell command. } ############################################################################## METHOD timeout { <p>The "timeout" method is used to control how long the SQLite library will wait for locks to clear before giving up on a database transaction. |
︙ | ︙ | |||
780 781 782 783 784 785 786 | ############################################################################## METHOD incrblob { <p>This method opens a TCL channel that can be used to read or write into a preexisting BLOB in the database. The syntax is like this:</p> <blockquote> | | | 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 | ############################################################################## METHOD incrblob { <p>This method opens a TCL channel that can be used to read or write into a preexisting BLOB in the database. The syntax is like this:</p> <blockquote> <i>dbcmd</i> <b>incrblob</b> <b>?-readonly?</b> <i>?DB? TABLE COLUMN ROWID</i> </blockquote> <p> The command returns a new TCL channel for reading or writing to the BLOB. The channel is opened using the underlying <a href="c3ref/blob_open.html">sqlite3_blob_open()</a> C-language |
︙ | ︙ | |||
834 835 836 837 838 839 840 | written. <i>Backup-filename</i> does not have to exist ahead of time, but if it does, it must be a well-formed SQLite database.</p> } ############################################################################## METHOD restore { | | | 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 | written. <i>Backup-filename</i> does not have to exist ahead of time, but if it does, it must be a well-formed SQLite database.</p> } ############################################################################## METHOD restore { <p>The "restore" method copies the content from a separate database file into the current database connection, overwriting any preexisting content. The command syntax is like this:</p> <blockquote> <i>dbcmd</i> <b>restore</b> ?<i>target-database</i>? <i>source-filename</i> </blockquote> |
︙ | ︙ |