Documentation Source Text

Check-in [213b37eef1]
Login

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

Overview
Comment:Updates to documentation for ATTACH.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 213b37eef143b4289cd74af722cdc44d3e7f29d0
User & Date: drh 2010-08-02 18:03:13.000
Context
2010-08-03
02:26
Updates to language documentation. (check-in: c412626afe user: drh tags: trunk)
2010-08-02
18:03
Updates to documentation for ATTACH. (check-in: 213b37eef1 user: drh tags: trunk)
13:05
Always generate the SEARCH box on the website. (check-in: 09c7a61e1a user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to main.mk.
94
95
96
97
98
99
100

101
102
103
104
105
106
107
	./tclsh $(SCANNER) src $(SRC)/ext/fts3/*.[ch]
	./tclsh $(SCANNER) src $(SRC)/ext/rtree/*.[ch]
	./tclsh $(SCANNER) tcl $(SRC)/test/*.test
	if test '' != '$(TH3)'; then \
	  ./tclsh $(SCANNER) th3 $(TH3)/mkth3.tcl; \
	  ./tclsh $(SCANNER) th3/req1 $(TH3)/req1/*.test; \
	  ./tclsh $(SCANNER) th3/cov1 $(TH3)/cov1/*.test; \

	fi
	if test '' != '$(SLT)'; then \
	  ./tclsh $(SCANNER) slt $(SLT)/test/evidence/*.test; \
	fi

# Copy and HTMLize evidence files
#







>







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
	./tclsh $(SCANNER) src $(SRC)/ext/fts3/*.[ch]
	./tclsh $(SCANNER) src $(SRC)/ext/rtree/*.[ch]
	./tclsh $(SCANNER) tcl $(SRC)/test/*.test
	if test '' != '$(TH3)'; then \
	  ./tclsh $(SCANNER) th3 $(TH3)/mkth3.tcl; \
	  ./tclsh $(SCANNER) th3/req1 $(TH3)/req1/*.test; \
	  ./tclsh $(SCANNER) th3/cov1 $(TH3)/cov1/*.test; \
	  ./tclsh $(SCANNER) th3/stress $(TH3)/stress/*.test; \
	fi
	if test '' != '$(SLT)'; then \
	  ./tclsh $(SCANNER) slt $(SLT)/test/evidence/*.test; \
	fi

# Copy and HTMLize evidence files
#
Changes to pages/lang.in.
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254

255
256
257
258
259
260
261
262
263

264
265
266
267
268
269
270
271
<p> ^The ATTACH DATABASE statement adds another database 
file to the current [database connection]. 
^The database-names 'main' and 
'temp' refer to the main database and the database used for 
temporary tables.  ^The main and temp databases cannot be attached or
detached.</p>

<p> ^You cannot create a new table with the same name as a table in 
an attached database, but you can attach a database which contains
tables whose names are duplicates of tables in the main database.  ^If
the system is not running in [shared cache mode], it is also permissible 
to attach the same database file multiple times.</p>

<p> ^(Tables in an attached database can be referred to using the syntax 
<i>database-name.table-name</i>.)^  ^If the name of the table is unique
across all attached databases and the main and temp databases, then the
<i>database-name</i> prefix is not required.  ^When a database is attached, 
all tables which don't have duplicate names become the default table
of that name.  ^Any tables of that name attached afterwards require the
database prefix. ^If the default table of a given name is detached, then
the last table of that name attached becomes the new default.</p>

<p>
^Transactions involving multiple attached databases are atomic,
assuming that the main database is not "[:memory:]".  ^(If the main

database is ":memory:" then 
transactions continue to be atomic within each individual
database file. But if the host computer crashes in the middle
of a [COMMIT] where two or more database files are updated,
some of those files might get the changes where others
might not.)^
</p>

<p> ^There is a compile-time limit of [SQLITE_MAX_ATTACHED]

attached database files.</p>

<tcl>
###############################################################################
Section {BEGIN TRANSACTION} transaction {*BEGIN COMMIT ROLLBACK}

BubbleDiagram begin-stmt
BubbleDiagram commit-stmt







<
<
<
<
<
<



|
|
|
|
<



|
>
|







|
>
|







230
231
232
233
234
235
236






237
238
239
240
241
242
243

244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<p> ^The ATTACH DATABASE statement adds another database 
file to the current [database connection]. 
^The database-names 'main' and 
'temp' refer to the main database and the database used for 
temporary tables.  ^The main and temp databases cannot be attached or
detached.</p>







<p> ^(Tables in an attached database can be referred to using the syntax 
<i>database-name.table-name</i>.)^  ^If the name of the table is unique
across all attached databases and the main and temp databases, then the
<i>database-name</i> prefix is not required.  ^If two or more tables in
different databases have the same name and the 
<i>database-name</i> prefix is not used on a table reference, then the
table chosen is the one in the database that was least recently attached.</p>


<p>
^Transactions involving multiple attached databases are atomic,
assuming that the main database is not "[:memory:]" and the 
[journal_mode] is not [WAL].  ^(If the main
database is ":memory:" or if the journal_mode is WAL, then 
transactions continue to be atomic within each individual
database file. But if the host computer crashes in the middle
of a [COMMIT] where two or more database files are updated,
some of those files might get the changes where others
might not.)^
</p>

<p> ^There is is a limit, set using [sqlite3_limit()] and 
[SQLITE_LIMIT_ATTACHED], to the number of databases that can be
simultaneously attached to a single database connection.</p>

<tcl>
###############################################################################
Section {BEGIN TRANSACTION} transaction {*BEGIN COMMIT ROLLBACK}

BubbleDiagram begin-stmt
BubbleDiagram commit-stmt